compute_Hsquared: Compute the likelihood ratio statistic comparing a stationary...

compute_HsquaredR Documentation

Compute the likelihood ratio statistic comparing a stationary Markov chain model for seq to a nonstationary model

Description

Compute the likelihood ratio statistic comparing a stationary Markov chain model for seq to a nonstationary model

Usage

compute_Hsquared(seq, L = 10, states = NULL, eps = 1e-17)

Arguments

seq

a vector containing observations from an stochastic process.

L

an integer specifying how many windows will be compared

states

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

eps

a small number to avoid zero probabilities

Value

a likelihood ratio statistic comparing H1 = not stationary vs H0 = stationary.

Examples

X <- rbinom(n = 1E5, size = 1, prob = 0.8)
compute_Hsquared(X)

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