logLik.glarma {glarma} | R Documentation |
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
## S3 method for class 'glarma'
logLik(object, deriv, ...)
Arguments
object |
An object of class |
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
|
... |
Further arguments passed to or from other methods. |
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.
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
.
See Also
coef.glarma
, residuals.glarma
,
fitted.glarma
, glarma
.
Examples
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)