| get.Niuj | R Documentation |
Counts, in a list of sequences, the transitions of the Markov
chain (Z_k, U_k)_{k \in \mathbb{N}}, where
(Z_k)_{k \in \mathbb{N}} is the semi-Markov chain and
(U_k)_{k \in \mathbb{N}} its backward recurrence time
(time already spent in the current state):
N_{iuj} = \sum_{k \ge 1} \mathbf{1}_{\{Z_{k - 1} = i,\ U_{k - 1} = u,\ Z_k = j\}}.
The couple (Z_k, U_k)_{k \in \mathbb{N}} is a
Markov chain (Barbu and Limnios, 2008, Section 6.2.1, Equation (6.5) and
Proposition 6.1, p. 137). These counts are the sufficient statistics of
the exact maximum likelihood estimator of a nonparametric semi-Markov
chain censored at the end of the sequences (Trevezas and Limnios, 2011).
get.Niuj(sequences)
sequences |
A list of vectors (of characters or numbers) representing the observed sequences of states. |
Notation (see smmR-package for the complete description of the
models): (Z_k)_{k \in \mathbb{N}} is the observed
semi-Markov chain and (U_k)_{k \in \mathbb{N}} its
backward recurrence time, U_k = k - S_{N(k)}.
U_k = 0 when the chain has just entered a new state at time
k; if Z_{k - 1} = i and U_{k - 1} = u, then either
Z_k = i and U_k = u + 1 (the sojourn in i goes on) or
Z_k = j \neq i and U_k = 0 (jump to j).
The diagonal counts N_{iui} are therefore the numbers of
times the sojourn in i goes on after u + 1 time units.
The states are taken in their order of first appearance in sequences
(unique(unlist(sequences))), as in get.processes.
A numeric array of dimension (s, k_{max}, s),
where s is the number of distinct observed states and
k_{max} the length of the longest observed sojourn: the
element [i, u + 1, j] is N_{iuj}, for
u = 0, \dots, k_{max} - 1. The dimensions are
named with the states and the values of u.
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.
S. Trevezas, N. Limnios. (2011). Exact MLE and asymptotic properties for nonparametric semi-Markov models. Journal of Nonparametric Statistics, 23(3), 719-739.
get.processes, fitsmm
seqs <- list(c("c", "c", "a", "a", "a", "g"), c("a", "g", "g"))
N <- get.Niuj(seqs)
dim(N) # states "c", "a", "g" (order of appearance), kmax = 3
# Transitions from state "a" after u = 0, 1, 2 time units
N["a", , ] # rows: u = 0, 1, 2; columns: next state "c", "a", "g"
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.