| logLik {HiddenMarkov} | R Documentation |
Provides methods for the generic function logLik.
## S3 method for class 'dthmm': logLik(object, fortran=TRUE, ...) ## S3 method for class 'mmglm': logLik(object, fortran=TRUE, ...) ## S3 method for class 'mmpp': logLik(object, fortran=TRUE, ...)
object |
an object with class "dthmm", "mmglm" or "mmpp". |
fortran |
logical, if TRUE (default) use the Fortran code, else use the R code. |
... |
other arguments. |
The methods provided here will always recalculate the log-likelihood even if it is already contained within the object. This enables the user to change parameter or data values within the object and recalculate the log-likelihood for the revised configuration.
The code for the methods "dthmm", "mmglm" and "mmpp" can be viewed by typing logLik.dthmm, logLik.mmglm or logLik.mmpp, respectively, on the R command line.
Returns the value of the log-likelihood.
Pi <- matrix(c(1/2, 1/2, 0,
1/3, 1/3, 1/3,
0, 1/2, 1/2),
byrow=TRUE, nrow=3)
x <- dthmm(NULL, Pi, c(0,1,0), "norm",
list(mean=c(1, 6, 3), sd=c(1, 0.5, 1)))
x <- simulate(x, nsim=100)
print(logLik(x))