# log-log model vs. poisson GAM terminology

If I get a log-log model by taking the log of many (but maybe not all) of the independent variables, and also take the log of the dependent variable, does this fall under the category of a generalized additive model (GAM)?

Edit to clarify my thought process: My thinking was that, transforming the dependent variable with a log may be equivalent to transforming the sum of independent variables with an exponential link function, so this seems like poisson regression which is a GLM, so I figured this could be a poisson GLM. Then, using logs on some independent variables as nonlinearity functions might then make this a poisson GAM?

Here is what I was looking at from the poisson regression wiki: • Do you mean generalized linear models (GLMs) or generalized additive models (GAMs)? – Gordon Smyth Jan 15 '18 at 1:25
• Sorry I meant GAM. fixed my typo. – Austin Jan 15 '18 at 1:29
• I'm not sure what you mean by "fall under the domain of" or "basis functions" but (i) transforming the dependent variable is not equivalent to any GLM and (ii) transforming all or some of the independent variable is not equivalent to a logarithm link function (log-linear model). Log-transforming the dependent variable is equivalent to a log-normal model which in turn is roughly equivalent to a gamma GLM, because the variance functions are the same. – Gordon Smyth Jan 15 '18 at 1:29
• Is logging the dependent variable equivalent to exponentiating the entire sum of independent variables? That's why I thought this would be considered a link function. By basis functions I meant the nonlinear functions in GAMs f_1()...f_n(). – Austin Jan 15 '18 at 1:32
• I'm still probably misunderstanding, but I edited my post to clarify my thought process. – Austin Jan 15 '18 at 1:42

These regressions model the expected value of a random variable as some function of the dependent variables. So if you take the $\log$ of $Y$ and assume a main effects model then the model is:

$$E(\log Y) = \beta_0 + \beta_1 x_1 + ... + \beta_p x_p$$

Since the $E()$ and $\log$ cannot be interchanged, this is not the same as

$$E(Y) = \exp(\beta_0 + \beta_1 x_1 + ... + \beta_p x_p)$$.

So saying 'transforming the dependent variable with a log may be equivalent to transforming the sum of independent variables with an exponential link function' is not correct - for two reasons 1) E() and log cannot be interchanged and 2) you don't just have the sum of independent variables, you have a linear combination of them.

However, both of the models above, can be thought of as GLM's where you model the mean as a linear function of the dependent variables ($\mu = g^{-1}(X\beta)$). The $\mu$ in the first represents the mean of $\log Y$ and in the second is the mean of $Y$. To complete the formulation, the distribution of the respective variable is specified. As stated in the comments, assuming $\log Y$ is normal is equivalent to $Y$ being log-normal.

As far as GAMs are concerned - they model the mean as:

$$g(E(Z)) = \beta_0 + f_1(x_1) + f_2(x_2) + ... + f_m(x_m)$$

where Z is some random variable. So taking $g$ as the identity, the first could be considered a GAM on $Z = \log Y$. Even if some of the x's on the right side are actually the logs of the original dependent variables. For example, if you had $m = 2$ and :

$$E(\log Y) = \beta_0 + \beta_1 \log x_1 + \beta_2 x_2$$

Then $f_1(x_1) = \beta_1 \log x_1$ and $f_2(x_2) = \beta_2 x_2$. The second case wouldn't fall into the GAM framework because there is no way to write the right hand side as a sum of $p$ functions, each a function of only one dependent variable.