| logLik.smm | R Documentation |
Methods of the generic functions stats::logLik, stats::AIC and stats::BIC for the Markov and semi-Markov models of the package: models specified by the user (mm, smmparametric, smmnonparametric) and fitted models (fitmm, fitsmm).
## S3 method for class 'smmparametric'
logLik(object, ...)
## S3 method for class 'smmnonparametric'
logLik(object, ...)
## S3 method for class 'smmfit'
logLik(object, ...)
## S3 method for class 'mm'
logLik(object, ...)
## S3 method for class 'mmfit'
logLik(object, ...)
## S3 method for class 'smmparametric'
AIC(object, ...)
## S3 method for class 'smmnonparametric'
AIC(object, ...)
## S3 method for class 'smmfit'
AIC(object, ...)
## S3 method for class 'mm'
AIC(object, ...)
## S3 method for class 'mmfit'
AIC(object, ...)
## S3 method for class 'smmparametric'
BIC(object, ...)
## S3 method for class 'smmnonparametric'
BIC(object, ...)
## S3 method for class 'smmfit'
BIC(object, ...)
## S3 method for class 'mm'
BIC(object, ...)
## S3 method for class 'mmfit'
BIC(object, ...)
object |
An object of S3 class |
... |
The argument |
Notation (see smmR-package for the complete description of the models):
\mathcal{L} is the likelihood, K the number of parameters of
the model (see get.Kpar), n the total length of the sequences and
s = \textrm{card}(E).
The log-likelihood \log \mathcal{L} is computed on
the sequences given in the argument sequences. For a fitted model
(class mmfit or smmfit), this argument is optional: by default, the
value computed at the estimation, on the sequences used for the
estimation, is returned. The information criteria are
AIC = -2 \log \mathcal{L} + 2 K, \qquad BIC = -2 \log \mathcal{L} + \log(n)\, K,
where K is the number of parameters of the model (see get.Kpar)
and n the total length of the sequences.
A numeric value: the log-likelihood, the AIC or the BIC.
V. S. Barbu, N. Limnios. (2008). Semi-Markov Chains and Hidden Semi-Markov Models Toward Applications - Their Use in Reliability and DNA Analysis. New York: Lecture Notes in Statistics, vol. 191, Springer.
get.Kpar, fitsmm, fitmm
states <- c("a", "c", "g", "t")
pij <- matrix(c(0, 0.2, 0.5, 0.3,
0.2, 0, 0.3, 0.5,
0.3, 0.5, 0, 0.2,
0.4, 0.2, 0.4, 0), ncol = 4, byrow = TRUE)
x <- smmparametric(states = states, init = rep(1/4, 4), ptrans = pij,
type.sojourn = "f", distr = "pois", param = c(2, NA))
seqs <- simulate(x, nsim = 5000, seed = 150)
est <- fitsmm(sequences = seqs, states = states, type.sojourn = "f",
distr = "pois")
# Fitted model: value at the estimation
logLik(est)
AIC(est)
BIC(est)
# Model specified by the user: the sequences must be given
logLik(x, sequences = seqs)
AIC(x, sequences = seqs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.