Description Usage Arguments Value Examples
Regime assignment (clustering) methods available include the unsupervised random forest, k-mean clustering, Fraley and Raftery Model-based clustering EM algorithm, and the Bai & Perron (2003) method for simultaneous estimation of multiple breakpoints.
1 |
data |
data.frame, matrix, ts, xts, zoo: Endogenous regressors |
method |
string: regime assignment technique ('rf', 'kmeans', 'EM', or 'BP) |
regime.n |
int: number of regimes to estimate (applies to kmeans and EM) |
data
as a data.frame with a regime column assigning rows to mutually exclusive regimes
1 2 3 4 5 6 7 8 9 10 11 12 13 | # simple time series
AA = c(1:100) + rnorm(100)
BB = c(1:100) + rnorm(100)
CC = AA + BB + rnorm(100)
date = seq.Date(from = as.Date('2000-01-01'), by = 'month', length.out = 100)
Data = data.frame(date = date, AA, BB, CC)
# estimate reigme
regime =
sovereign::regimes(
data = Data,
method = 'kmeans',
regime.n = 3)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.