Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/logLik.lognlm.R
The function returns the log-likelihood value of the log Normal linear regression model evaluated at the estimated coefficients
1 2 3 4 |
object, fit |
A |
full |
If |
scale |
Optional numeric specifying the scale parameter of the model. Currenty not used. |
k |
Optional numeric specifying the penalty of the edf in the AIC formula. If |
... |
optional arguments (nothing in this method). |
If object
has been obtained via lognlm(.., lik=TRUE)
, logLik.lognlm
returns the log likelihood (kernel or complete, depending on argument full
), otherwise the sum of log residuals, sum(log(y)-log(mu))^2. The value returned by AIC
is based on the kernel log likelihood or the the sum of log residuals, while extractAIC
can return the AIC (or BIC) using the full log likelihood (via extractAIC(.., full=TRUE)
)
The log likelihood (or the sum of log residuals squared) of the model fit object
Vito Muggeo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# o is the fit object, see ?lognlm
n=50
s=.4
#covariates
x<-seq(.1,10,l=n)
#response
set.seed(1234) #just to get reproducible results..
mu<- 10+.5*x #linear regression function
y<-rlnorm(n, log(mu)-s^2/2, s) #data..
o<- lognlm(y~x, lik=TRUE) #the model
logLik(o) #the kernel log likelihood value
logLik(o, full=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.