Why Back-Transformation Needs Care
A regression fitted to \(\log Y\) predicts on the log scale. Exponentiating a fitted value returns a prediction in the units of \(Y\), but it does not automatically return the conditional mean of \(Y\). The distinction matters whenever a decision, such as setting a hypothetical benefit amount or estimating an average payment, depends on an expected value rather than a typical value.
The right back-transformation depends on what is assumed about the error distribution. Under errors symmetric about zero, exponentiating the fitted log response gives the conditional median. Under normally distributed log errors, a variance correction gives the conditional mean. These are different summaries of a positive, typically right-skewed conditional distribution.
The model concerns the conditional distribution of \(Y\) at specified predictor values. Unless stated otherwise, claims below are conditional on those values. A prediction interval, which describes uncertainty for an individual future response, is not the same thing as either a conditional mean estimate or a conditional median estimate.
Why Exponentiation Gives a Median
Suppose the conditional distribution of \(\varepsilon\) is symmetric about zero. In particular, zero is a conditional median of \(\varepsilon\). Since the exponential function is strictly increasing, it preserves the order of values and therefore transforms a median into a median. Thus a conditional median of \(\log Y\), \(\eta(x)\), becomes a conditional median of \(Y\), \(\exp(\eta(x))\).
This argument needs the error median to be zero; symmetry about zero is a convenient sufficient condition. It does not require normally distributed errors. It does require care if the median is not unique: the displayed expression gives a conditional median when zero is a conditional median of the error. In practice, replacing \(\eta(x)\) by its fitted value gives the estimated conditional median \(\exp\{\hat{\eta}(x)\}\).
Worked Example: A Median With Symmetric, Non-Normal Errors
A hypothetical model for a positive claim-related payment has fitted log response \(\hat{\eta}(x)=\log(100)\) at a specified risk profile. Assume the log error at this profile is uniformly distributed on \([-0.2,0.2]\). The distribution is symmetric about zero, but it is not normal. There is no interest-rate or mortality assumption in this regression problem.
Method. Use the conditional median result for symmetric log errors. Since the error median is zero, the estimated original-scale conditional median is $$ \exp\{\hat{\eta}(x)\}=\exp\{\log(100)\}=100. $$ Thus the conditional median payment is estimated as $100.00.
Check why this is not the mean. For this uniform error distribution, the conditional mean is $$ E[Y\mid x] =100E[\exp(\varepsilon)] =100\left(\frac{1}{0.4}\int_{-0.2}^{0.2}e^z\,dz\right) =100\left(\frac{e^{0.2}-e^{-0.2}}{0.4}\right). $$ Using \(e^{0.2}=1.22140\) and \(e^{-0.2}=0.81873\), the factor is \((1.22140-0.81873)/0.4=1.00668\). The mean is therefore $100.67, rounding only the final dollar amount to cents.
The median is $100.00, while the mean is about $100.67. The method avoids the mistake of assuming that symmetry on the log scale makes the original-scale mean equal to the exponentiated log prediction.
The Lognormal Correction for a Conditional Mean
A more specific assumption allows the conditional mean to be calculated. Suppose the error is normally distributed with conditional mean zero and constant variance \(\sigma^2\): \(\varepsilon\mid x\sim N(0,\sigma^2)\). Then \(\log Y\mid x\sim N(\eta(x),\sigma^2)\), so \(Y\mid x\) has a lognormal distribution. Its median is \(\exp\{\eta(x)\}\), but its mean is larger when \(\sigma^2>0\).
The factor \(\exp(\sigma^2/2)\) is called the lognormal correction, or bias correction in this setting. It adjusts for the fact that exponentiation is nonlinear. It applies when the conditional log error is normal with the stated variance. If log errors are not normal, this particular correction is not generally valid; symmetry by itself is enough for the median result, but not for this mean formula.
Deriving the Mean Correction
The correction follows from the moment-generating function of a normal random variable. If \(Z\sim N(0,\sigma^2)\), then \(E[e^{tZ}]=e^{t^2\sigma^2/2}\). Taking \(t=1\) and factoring out the nonrandom \(\exp\{\eta(x)\}\) gives the result directly.
The same conclusion can be seen by completing the square in the normal density. The moment-generating-function argument is shorter, but both show why the variance enters as one-half of \(\sigma^2\), not as \(\sigma^2\). The correction equals one when \(\sigma^2=0\) and is greater than one when \(\sigma^2>0\).
Worked Example: Estimating a Lognormal Conditional Mean
For a hypothetical positive benefit amount, suppose the fitted log response at a given profile is \(\hat{\eta}(x)=\log(120)\). Assume the conditional log error is \(N(0,0.25)\), so the variance is \(\sigma^2=0.25\) and the standard deviation is \(0.5\). There is no interest-rate or mortality assumption.
Method. First identify the original-scale median: \(\exp\{\log(120)\}=120\). Then apply half the variance in the mean correction: $$ \widehat{E[Y\mid x]} =\exp\{\log(120)+\tfrac{1}{2}(0.25)\} =120e^{0.125}. $$
Using \(e^{0.125}=1.133148\), the estimated mean is \(120(1.133148)=135.9778\), or $135.98 to the nearest cent. The estimated median is $120.00. The mean exceeds the median because the conditional lognormal distribution is right-skewed.
Check. The correction factor is greater than one, as it must be for positive variance. The method avoids calling the exponentiated fitted log response the conditional mean.
Estimating the Variance From Regression Residuals
In an ordinary least-squares regression with an intercept and \(p\) fitted coefficients in total, the residual variance estimate is \(s^2=\mathrm{RSS}/(n-p)\), where \(\mathrm{RSS}\) is the residual sum of squares and \(n-p\) is the residual degrees of freedom. Under the usual linear-model assumptions, this estimates the common log-error variance \(\sigma^2\). The mean correction uses \(s^2/2\), not the standard deviation \(s\), and not the variance divided by the sample size.
This estimate assumes a common conditional error variance. If log-error variability changes with predictor values, a single residual variance may not represent the variance at the prediction profile. Also, the plug-in formula estimates the conditional mean under the fitted model; it does not by itself provide a confidence interval or account fully for uncertainty in estimated regression coefficients.
Worked Example: Using Residual Sum of Squares
A hypothetical log-response regression for positive repair costs uses \(n=8\) observations and \(p=3\) fitted coefficients, including the intercept. Its residual sum of squares on the log scale is \(0.20\). At a new profile, the fitted log response is \(\hat{\eta}(x)=\log(200)\). Assume independent normal log errors with mean zero and common variance \(\sigma^2\). No interest-rate or mortality assumption applies.
Step 1: Estimate the error variance. The residual degrees of freedom are \(n-p=8-3=5\), so $$ s^2=\frac{\mathrm{RSS}}{n-p}=\frac{0.20}{5}=0.04. $$
Step 2: Find the median estimate. Exponentiating the fitted log response gives \(\exp\{\log(200)\}=200\), so the estimated conditional median is $200.00.
Step 3: Correct for the mean. $$ \widehat{E[Y\mid x]} =\exp\{\log(200)+\tfrac{1}{2}(0.04)\} =200e^{0.02}. $$ Since \(e^{0.02}=1.020201\), the estimate is \(200(1.020201)=204.0402\), or $204.04 to the nearest cent.
The estimated mean is $204.04 and the estimated median is $200.00. The calculation avoids using \(0.20\), the residual sum of squares, directly as the variance; it must first be divided by the residual degrees of freedom.
Common Mistakes and Interpretation
A common trap is to exponentiate the fitted log response and label the result the expected response. For a lognormal model, that calculation returns the conditional median. A second error is to apply the full variance in the exponent. The correct correction is half the log-error variance.
Worked Example: Correcting a Variance-Factor Error
At a hypothetical profile, let \(\hat{\eta}(x)=\log(100)\) and assume a normal log error with mean zero and variance \(0.16\). There is no interest-rate or mortality assumption.
Wrong calculation. Using the full variance gives \(\exp\{\log(100)+0.16\}=100e^{0.16}\). Since \(e^{0.16}=1.173511\), this is $117.35. It is not the lognormal conditional mean.
Correction. The formula uses half the variance: $$ \exp\{\log(100)+\tfrac{1}{2}(0.16)\} =100e^{0.08}. $$ Using \(e^{0.08}=1.083287\), the estimated conditional mean is $108.33 to the nearest cent. The conditional median remains $100.00.
The full-variance calculation overcorrects because the normal moment-generating function contributes \(t^2\sigma^2/2\), which is \(\sigma^2/2\) at \(t=1\).
For any particular prediction, state what is being estimated and which assumptions justify it. Exponentiation alone supports a median interpretation when the conditional log error has median zero. The lognormal correction supports a mean interpretation only under the normal-error model, or when that model is an adequate approximation. If the error distribution is unspecified, the conditional mean cannot in general be recovered from the fitted log response alone.
Check Your Understanding
For each problem, distinguish the original-scale median from the mean and apply a correction only when the assumptions support it.
- A hypothetical positive payment model has fitted log response \(\log(150)\) and a conditional log error symmetric about zero. What is the estimated conditional median, and can the conditional mean be determined from the information given? (Answer: Median $150.00; the mean cannot be determined from symmetry alone.)
- At a hypothetical profile, \(\hat{\eta}(x)=\log(90)\) and the conditional log error is \(N(0,0.09)\). Find the estimated mean and median. (Answer: Mean $94.14; median $90.00.)
- A hypothetical loss amount has fitted log response \(\log(250)\) and normal log error with standard deviation \(0.20\). Find the conditional mean estimate and state which variance enters the correction. (Answer: Variance \(0.04\); mean \(250e^{0.02}=\)$255.05.)
- A log-response regression has \(n=10\), \(p=2\), residual sum of squares \(0.32\), and fitted log response \(\log(400)\) at a profile. Under independent normal log errors with common variance, calculate the residual variance estimate and the corrected mean. (Answer: \(s^2=0.32/(10-2)=0.04\); mean \(400e^{0.02}=\)$408.08.)
- Two hypothetical profiles have fitted log responses \(\log(75)\) and \(\log(100)\), respectively, with the same normal log-error variance \(0.16\). Give the mean estimate for each and their ratio, then state whether the median ratio is the same. (Answer: Means $81.25 and $108.33; ratio \(100/75=1.3333\); the median ratio is also \(100/75=1.3333\).)