| get.H | R Documentation |
Computes, from a semi-Markov kernel q, the diagonal
matrix-valued function
H(k) = \textrm{diag}(H_i(k);\ i \in E)
(Barbu and Limnios, 2008, Definition 3.4, p. 47, and p. 51), where
H_i is the cumulative distribution function of the sojourn time in
state i:
H_i(k) = P(X_{n + 1} \le k \mid J_n = i) = \sum_{l = 1}^{k} \sum_{j \in E} q_{ij}(l).
get.H(q)
q |
A numeric array of dimension |
Notation (see smmR-package for the complete description of the
models): (J_n)_{n \in \mathbb{N}} is the embedded Markov
chain, (X_n)_{n \in \mathbb{N}^*} the sojourn times,
q the semi-Markov kernel and s = \textrm{card}(E).
The function I - H(k), where I is the identity matrix,
gives the survival functions
\overline{H}_i(k) = P(X_{n + 1} > k \mid J_n = i)
of the sojourn times; it is used to compute the transition function
P = \psi * (I - H) (see get.P).
H_i(k) tends to 1 as k tends to infinity. When the sojourn
times have a finite support, H_i(k) = 1 for k larger than the
maximal sojourn time.
A numeric array of dimension (s, s, k + 1) whose slice
l + 1 is the diagonal matrix H(l), for
l = 0, \dots, k.
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.kernel, get.psi, get.P, meanSojournTimes
states <- c("a", "b", "c")
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)
x <- smmparametric(states = states, init = c(1/3, 1/3, 1/3),
ptrans = ptrans, type.sojourn = "fi",
distr = c("geom", "pois", "dweibull"), param = param)
q <- get.kernel(x, k = 20)
H <- get.H(q)
H[, , 6] # H(5)
t(apply(H, 3, diag))[1:6, ] # H_i(l), l = 0, ..., 5
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.