| ParamHMMR-class {samurais} | R Documentation |
A Reference Class which contains parameters of a HMMR model.
Description
ParamHMMR contains all the parameters of a HMMR model. The parameters are calculated by the initialization Method and then updated by the Method implementing the M-Step of the EM algorithm.
Fields
XNumeric vector of length m representing the covariates/inputs
x_{1},\dots,x_{m}.YNumeric vector of length m representing the observed response/output
y_{1},\dots,y_{m}.mNumeric. Length of the response/output vector
Y.KThe number of regimes (HMMR components).
pThe order of the polynomial regression.
variance_typeCharacter indicating if the model is homoskedastic (
variance_type = "homoskedastic") or heteroskedastic (variance_type = "heteroskedastic"). By default the model is heteroskedastic.priorThe prior probabilities of the Markov chain.
prioris a row matrix of dimension(1, K).trans_matThe transition matrix of the Markov chain.
trans_matis a matrix of dimension(K, K).maskMask applied to the transition matrices
trans_mat. By default, a mask of order one is applied.betaParameters of the polynomial regressions.
\boldsymbol{\beta} = (\boldsymbol{\beta}_{1},\dots,\boldsymbol{\beta}_{K})is a matrix of dimension(p + 1, K), withpthe order of the polynomial regression.pis fixed to 3 by default.sigma2The variances for the
Kregimes. If HMMR model is heteroskedastic (variance_type = "heteroskedastic") thensigma2is a matrix of size(K, 1)(otherwise HMMR model is homoskedastic (variance_type = "homoskedastic") andsigma2is a matrix of size(1, 1)).nuThe degree of freedom of the HMMR model representing the complexity of the model.
phiA list giving the regression design matrices for the polynomial and the logistic regressions.
Methods
initParam(try_algo = 1)Method to initialize parameters
mask,prior,trans_mat,betaandsigma2.If
try_algo = 1thenbetaandsigma2are initialized by segmenting the time seriesYuniformly intoKcontiguous segments. Otherwise,betaandsigma2are initialized by segmenting randomly the time seriesYintoKsegments.MStep(statHMMR)Method which implements the M-step of the EM algorithm to learn the parameters of the HMMR model based on statistics provided by the object
statHMMRof class StatHMMR (which contains the E-step).