Hi Prof Brain Ripley, If we know the residual of the model, how could we calculate the Log likelihood? Thanks for your help, Yunteng Lao [[alternative HTML version deleted]]
Hi,> If we know the residual of the model, how could we calculate the Log > likelihood?It depends on the model (lm? glm? nls?). Why not using directly the logLik function? x <- rnorm(100, 10) y <- rnorm(100, 10) model1 <- lm(y ~ x) logLik(model1) model2 <- glm(y ~ x, family=gaussian) logLik(model2) model3 <- glm(y ~ x, family=Gamma) logLik(model3) Cheers, Arnaud.