get_contingency_array: Compute transitions of a given order

View source: R/order_selection.r

get_contingency_arrayR Documentation

Compute transitions of a given order

Description

Compute transitions of a given order

Usage

get_contingency_array(seq, order, states = NULL)

Arguments

seq

a vector containing observations from an stochastic process.

order

the order of the transitions to be computed (an integer).

states

the possible states of the Markov chain. If NULL, will be deduced from 'seq'.

Value

an array with the transitions in the format n_ijk, where i, j, k are in states(seq).

Examples

X <- rbinom(n = 1E5, size = 1, prob = 0.8)
get_contingency_array(X, order = 3)

maxbiostat/BinaryMarkovChains documentation built on Dec. 11, 2023, 4:29 a.m.