logLik.maxLik.RdReturn the log likelihood value of objects of class maxLik
and summary.maxLik.
A scalar numeric, log likelihood of the estimated model. It has attribute “df”, number of free parameters.
## ML estimation of exponential duration model:
t <- rexp(100, 2)
loglik <- function(theta) log(theta) - theta*t
gradlik <- function(theta) 1/theta - t
hesslik <- function(theta) -100/theta^2
## Estimate with analytic gradient and hessian
a <- maxLik(loglik, gradlik, hesslik, start=1)
## print log likelihood value
logLik( a )
#> [1] -36.21703
#> attr(,"df")
#> [1] 1
## print log likelihood value of summary object
b <- summary( a )
logLik( b )
#> [1] -36.21703
#> attr(,"df")
#> [1] 1