I have an outcome which may be transformed in cases of egregious departures from normality to its Box-Cox optimal normal transformation in an unconditional model.
How is the likelihood calculated for the $\lambda$ parameter?
For instance, if I generate data according to a skewnormal model:
set.seed(123)
y <- rlnorm(100, 1, 1)
x <- rep(1, 100)
o <- boxcox(y ~ x)
I get as the optimal $\lambda$ a value close to 0 as expected which achieves a maximum of $\log(L(x, y,\lambda)) \approx -200$ .
However, when I evaluate the log-likelihood of the log transformed response using logLik(glm(y ~ 1, family=gaussian(link=log)))
the value is:
'log Lik.' -295.7451 (df=2)
I would expect those values to be the same.