get.Niuj: Counting process N_iuj of the couple (state, backward...

View source: R/get.Niuj.R

get.NiujR Documentation

Counting process Niuj of the couple (state, backward recurrence time)

Description

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

Usage

get.Niuj(sequences)

Arguments

sequences

A list of vectors (of characters or numbers) representing the observed sequences of states.

Details

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.

Value

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.

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.

S. Trevezas, N. Limnios. (2011). Exact MLE and asymptotic properties for nonparametric semi-Markov models. Journal of Nonparametric Statistics, 23(3), 719-739.

See Also

get.processes, fitsmm

Examples

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"


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