HMMR: Flexible and user-friendly probabilistic segmentation of time series
(or structured longitudinal data) with regime changes by a regression model
governed by a hidden Markov process, fitted by the EM (Baum-Welch) algorithm.

It was written in R Markdown, using the knitr
package for production.

See help(package="samurais") for further details and references provided by citation("samurais").

Load data

data("univtoydataset")

Set up HMMR model parameters

K <-5# Number of regimes (states)
p <-3# Dimension of beta (order of the polynomial regressors)
variance_type <-"heteroskedastic"# "heteroskedastic" or "homoskedastic" model