get.H: Cumulative distribution functions of the sojourn times in...

View source: R/get.H.R

get.HR Documentation

Cumulative distribution functions of the sojourn times in each state

Description

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).

Usage

get.H(q)

Arguments

q

A numeric array of dimension (s, s, k + 1), where s = \textrm{card}(E), giving the values of a semi-Markov kernel at times 0, \dots, k, typically the output of get.kernel (or of get.qy).

Details

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.

Value

A numeric array of dimension (s, s, k + 1) whose slice l + 1 is the diagonal matrix H(l), for l = 0, \dots, k.

References

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.

See Also

get.kernel, get.psi, get.P, meanSojournTimes

Examples

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


smmR documentation built on Nov. 28, 2026, 1:06 a.m.