View source: R/performance_metrics.R
split_switching_ratio | R Documentation |
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.
split_switching_ratio(samples, k = 2)
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 |
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.
a list of scaled number of state transitions (between 0 and 1) in each of the k
windows.
switching_ratio
MC_neff
scaled_alpha
scaled_average_transitions
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.