form_Y: Vector of state-transitions.

View source: R/auxiliary_functions.R

form_YR Documentation

Vector of state-transitions.

Description

Constructs the binary vector of state transitions given a vector x.

Usage

form_Y(x)

Arguments

x

vector of length M containing realisations of a two-state (binary) discrete-time Markov chain.

Value

vector of state-transitions (changes).

Examples

X <- c(0, 1, 0, 1, 1, 0, 1)
Y <- form_Y(X)
sum(Y) # number of state-transitions (changes)

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