compute_Gsquared: Compute the likelihood ratio statistic comparing a...

View source: R/order_selection.r

compute_GsquaredR Documentation

Compute the likelihood ratio statistic comparing a second-order to a first-order Markov chain model for seq

Description

Compute the likelihood ratio statistic comparing a second-order to a first-order Markov chain model for seq

Usage

compute_Gsquared(seq, states = NULL)

Arguments

seq

a vector containing observations from an stochastic process.

Details

Under the null, G^2 has a chi-square(2) distribution.

Value

the likelihood ratio statistic (G^2) comparing a second-order model to a first-order one.

Examples

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

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