Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logLik.maxLik

Return the log likelihood value


Description

Return the log likelihood value of objects of class maxLik and summary.maxLik.

Usage

## S3 method for class 'maxLik'
logLik( object, ... )
## S3 method for class 'summary.maxLik'
logLik( object, ... )

Arguments

object

object of class maxLik or summary.maxLik, usually a model estimated with Maximum Likelihood

...

additional arguments to methods

Value

A scalar numeric, log likelihood of the estimated model. It has attribute “df”, number of free parameters.

Author(s)

Arne Henningsen, Ott Toomet

See Also

Examples

## 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 )
## print log likelihood value of summary object
b <- summary( a )
logLik( b )

maxLik

Maximum Likelihood Estimation and Related Tools

v1.4-8
GPL (>= 2)
Authors
Ott Toomet <otoomet@gmail.com>, Arne Henningsen <arne.henningsen@gmail.com>, with contributions from Spencer Graves and Yves Croissant
Initial release
2021-03-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.