logLik.maxLik: Return the log likelihood value

Description Usage Arguments Value Author(s) See Also Examples

View source: R/logLik.maxLik.R

Description

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

Usage

1
2
3
4
## 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

maxLik

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## 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 )

Example output

Loading required package: miscTools

Please cite the 'maxLik' package as:
Henningsen, Arne and Toomet, Ott (2011). maxLik: A package for maximum likelihood estimation in R. Computational Statistics 26(3), 443-458. DOI 10.1007/s00180-010-0217-1.

If you have questions, suggestions, or comments regarding the 'maxLik' package, please use a forum or 'tracker' at maxLik's R-Forge site:
https://r-forge.r-project.org/projects/maxlik/
[1] -24.02338
[1] -24.02338

maxLik documentation built on Nov. 25, 2020, 3 a.m.