plot_regime_model: Plot the state probabilities from 'find_regimes()'

View source: R/plot_regime_model.R

plot_regime_modelR Documentation

Plot the state probabilities from find_regimes()

Description

Plot the state probabilities from find_regimes()

Usage

plot_regime_model(
  model,
  probs = c(0.05, 0.95),
  type = c("probability", "means"),
  regime_prob_threshold = 0.9,
  plot_prob_indices = NULL,
  flip_regimes = FALSE
)

Arguments

model

A model returned by find_regimes().

probs

A numeric vector of quantiles to plot the credible intervals at. Defaults to c(0.05, 0.95).

type

Whether to plot the probabilities (default) or means.

regime_prob_threshold

The probability density that must be above 0.5. Defaults to 0.9 before we classify a regime (only affects "means" plot).

plot_prob_indices

Optional indices of probability plots to plot. Defaults to showing all.

flip_regimes

Optional whether to flip regimes in plots, defaults to FALSE

Details

Note that the original timeseries data (dots) are shown scaled between 0 and 1.

Examples


data(Nile)
m <- fit_regimes(log(Nile), n_regimes = 2, chains = 1, iter = 50)
plot_regime_model(m)
plot_regime_model(m, plot_prob_indices = c(2))
plot_regime_model(m, type = "means")



bayesdfa documentation built on June 22, 2024, 12:17 p.m.