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.

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to