Learn R Programming

maxLik (version 1.3-2)

AIC.maxLik: Methods for the various standard functions

Description

These are methods for the maxLik related objects. See also the documentation for the corresponding generic functions

Usage

## S3 method for class 'maxLik':
AIC(object, \dots, k=2)
## S3 method for class 'maxim':
coef(object, \dots)
## S3 method for class 'maxLik':
stdEr(x, eigentol=1e-12, \dots)

Arguments

object
a maxLik object (or a maxim object for coef)
k
numeric, the penalty per parameter to be used; the default k = 2 is the classical AIC.
x
a maxLik object
eigentol
The standard errors are only calculated if the ration of the smallest and largest eigenvalue of the Hessian matrix is less than eigentol. Otherwise the Hessian is treated as singular.
...
other arguments for methods

Details

[object Object],[object Object],[object Object]

Examples

Run this code
## estimate mean and variance of normal random vector
set.seed( 123 )
x <- rnorm(50, 1, 2 )
## log likelihood function.
## Note: 'param' is a vector
llf <- function( param ) {
   mu <- param[ 1 ]
   sigma <- param[ 2 ]
   return(sum(dnorm(x, mean=mu, sd=sigma, log=TRUE)))
}
## Estimate it.  Take standard normal as start values
ml <- maxLik(llf, start = c(mu=0, sigma=1) )

coef(ml)
stdEr(ml)
AIC(ml)

Run the code above in your browser using DataLab