#Regime-switching with no covariates (self-transition ID)
b <- prep.regimes(values=matrix(0, 3, 3),
params=matrix(c(0, 'p1', 'p2', 'p3', 0, 'p4', 'p5', 'p6', 0), 3, 3))
#Regime switching with no covariates (second regime ID)
b <- prep.regimes(values=matrix(0, 3, 3),
params=matrix(c('p1', 'p2', 'p3', 0, 0, 0, 'p4', 'p5', 'p6'), 3, 3))
#2 regimes with three covariates
b <- prep.regimes(values=matrix(c(0), 2, 8),
params=matrix(c(paste0('p', 8:15), rep(0, 8)), 2, 8),
covariates=c('x1', 'x2', 'x3'))
Run the code above in your browser using DataLab