split_switching_ratio: Split-Scaled number of state changes

View source: R/performance_metrics.R

split_switching_ratioR Documentation

Split-Scaled number of state changes

Description

Computes the ratio between the number of observed state changes and the maximum possible number of state changes given the observed occupation time in a number k of windows.

Usage

split_switching_ratio(samples, k = 2)

Arguments

samples

a collection of N samples from a two-state Markov chain.

k

a number of windows into which to break up the samples. Default is k=2.

Details

This function breaks up the samples into k windows computes switching_ratio for each one. Works in the same spirit as split-Rhat and other metrics which compare one part of the chain to the others.

Value

a list of scaled number of state transitions (between 0 and 1) in each of the k windows.

See Also

switching_ratio MC_neff scaled_alpha scaled_average_transitions

Examples

X <- rbinom(1E6, size = 1, prob = .2)
split_switching_ratio(X, k = 2)
split_switching_ratio(X, k = 11)
plot(split_switching_ratio(X, k = 200), type = "l")

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