fit_regimes: Fit models with differing numbers of regimes to trend data

Description Usage Arguments Examples

View source: R/fit_regimes.R

Description

Fit models with differing numbers of regimes to trend data

Usage

1
2
3
4
5
6
7
8
9
fit_regimes(
  y,
  sds = NULL,
  n_regimes = 2,
  iter = 2000,
  thin = 1,
  chains = 1,
  ...
)

Arguments

y

Data, time series or trend from fitted DFA model.

sds

Optional time series of standard deviations of estimates. If passed in, residual variance not estimated. Defaults to NULL.

n_regimes

Number of regimes to evaluate, defaults 2

iter

MCMC iterations, defaults to 2000.

thin

MCMC thinning rate, defaults to 1.

chains

MCMC chains, defaults to 1 (note that running multiple chains may result in a label switching problem where the regimes are identified with different IDs across chains).

...

Other parameters to pass to rstan::sampling().

Examples

1
2
data(Nile)
fit_regimes(log(Nile), iter = 50, n_regimes = 1)

bayesdfa documentation built on May 29, 2021, 1:06 a.m.