| get.Kpar | R Documentation |
Returns the number of parameters of a Markov or semi-Markov model, used in the computation of the information criteria AIC and BIC (see logLik.smm).
get.Kpar(x)
x |
An object of S3 class |
Notation (see smmR-package for the complete description of the
models): s = \textrm{card}(E) is the number of states,
k the order of a Markov chain and k_{max} the maximal
sojourn time of a nonparametric semi-Markov model.
The number of parameters is:
Markov chain of order k (mm, mmfit): the number of free
transition probabilities, (s - 1) s^k;
parametric semi-Markov model (smmparametric): the number of
parameters of the sojourn time distributions, i.e. the sum over the
distributions of distr of 1 ("geom", "pois", "unif") or 2
("nbinom", "dweibull");
nonparametric semi-Markov model (smmnonparametric) with maximal
sojourn time k_{max}: s (s - 2) (k_{max} - 1)
for "fij", s (k_{max} - 1) for "fi" and
"fj", and k_{max} - 1 for "f".
A positive integer giving the number of parameters.
logLik.smm, mm, smmparametric, smmnonparametric
# Markov chain of order 2 on 2 states: (2 - 1) * 2^2 = 4 parameters
x <- mm(states = c("a", "b"), init = rep(1/4, 4), k = 2,
ptrans = matrix(c(0.9, 0.1, 0.5, 0.5, 0.2, 0.8, 0.3, 0.7),
nrow = 4, byrow = TRUE))
get.Kpar(x)
# Parametric semi-Markov model: geom (1) + pois (1) + dweibull (2) = 4
ptrans <- matrix(c(0, 0.6, 0.4,
0.5, 0, 0.5,
0.7, 0.3, 0), nrow = 3, byrow = TRUE)
param <- matrix(c(0.3, 2, 0.6,
NA, NA, 0.8), nrow = 3)
y <- smmparametric(states = c("a", "b", "c"), init = c(1/3, 1/3, 1/3),
ptrans = ptrans, type.sojourn = "fi",
distr = c("geom", "pois", "dweibull"), param = param)
get.Kpar(y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.