I have two regression models. One is a simple linear regression model ($y$ is regressed on $x_i$'s), while the other is a double log model (log of $y$ is regressed on log of the $x_i$'s). They have the same number of independent variables ($k$ is the same for both).

Can I use the Akaike criterion to compare which model has a better fit?

  • 2
    $\begingroup$ In principle you cannot use the AIC to compare these models because the dependent variable is not the same ($y$ and $log(y)$). See this post for further details. $\endgroup$ – javlacalle Apr 12 '15 at 15:08

You cannot use the AIC to compare these. The AIC is calculated as:
$$ {\rm AIC} = - 2\log(L) + 2k $$ where $L$ is the likelihood associated with the model, and $k$ is the number of parameters in the model. If you calculate the AIC for multiple models, you would choose the model with the lowest AIC value.

It is important to note that using this formula makes certain assumptions. For example, it assumes that every parameter added to the model contributes an equivalent amount of flexibility to the model's ability to fit the data. Since the models you are discussing have the same number of parameters (in fact the exact same parameters, I gather), this part of the formula drops out. Thus, you are simply comparing the likelihoods of the two models. Since these are on different scales, they are not comparable.

Consider this quick demonstration, coded in R:

set.seed(5403)                    # this makes the example exactly reproducible
x  = rnorm(100, mean=150, sd=17)  # the true data generating process 
y  = 92 + .5*x + rnorm(100, mean=0, sd=1)
lx = log(x)                       # taking logs
ly = log(y)

m   = lm(y~x)             
llm = lm(ly~lx)
AIC(m)    # [1]  287.3273         # this is the right model
AIC(llm)  # [1] -726.0908         # this is the model with the lowest AIC
  • 2
    $\begingroup$ (+1) The OP may also be interested in the so-called Jacobian term. It can be checked that the density of the original data $y_t$ can be written in terms of $log(y_t)$ as follows: $f(y_t) = f(\log y_t) / y_t$. Thus, the log-likelihood function for the data in logs can be adjusted in terms of the original scale by subtracting the Jacobian term $-\sum \log y_t$. In the example, we would get that the adjusted AIC value for the model is -2*(logLik(llm) - sum(log(y)) ) + 2*3 equal to 298.0504, this value is comparable to the AIC for the original data, AIC(m). $\endgroup$ – javlacalle Apr 12 '15 at 18:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.