Learn R Programming

glarma (version 1.4-0)

logLik.glarma: Extract Log-Likelihood from GLARMA Models

Description

logLik is a generic function which extracts the GLARMA model log-likelihood from objects returned by modeling functions.

Usage

"logLik"(object, deriv, ...)

Arguments

object
An object of class "glarma", a result of a call to glarma.
deriv
Numeric; either "0", "1" or "2". It is used to choose and extract the log-likehood, its derivative or its second derivative respectively from the "glarma" object. The default is "0".
...
Further arguments passed to or from other methods.

Value

The log-likelihood, the derivative of the log-likelihood or the second derivative of the log-likelihood extracted from the GLARMA model object object.

Details

This is an S3 generic function. logLik returns the log-likelihood, its derivative, or its second derivative from the object of class glarma based on the value of the argument deriv. "0" is for the log-likelihood, "1" is for the first derivative of log-likelihood and "2" is for the second derivative of the log-likelihood.

See Also

coef.glarma, residuals.glarma, fitted.glarma, glarma.

Examples

Run this code
data(Polio)
Y <- Polio[, 2]
X <- as.matrix(Polio[, 3:8])
glarmamod <- glarma(Y, X, thetaLags = c(1, 2, 5), type = "Poi", method ="FS",
                    residuals = "Pearson", maxit = 100 , grad = 1e-6)

logLik(glarmamod, deriv = 0)
logLik(glarmamod, deriv = 1)
logLik(glarmamod, deriv = 2)

Run the code above in your browser using DataLab