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
X
Numeric vector of length m representing the covariates/inputs
.
Y
Numeric vector of length m representing the observed response/output
.
m
Numeric. Length of the response/output vector
Y
.K
The number of regimes (HMMR components).
p
The order of the polynomial regression.
variance_type
Character indicating if the model is homoskedastic (
variance_type = "homoskedastic"
) or heteroskedastic (variance_type = "heteroskedastic"
). By default the model is heteroskedastic.prior
The prior probabilities of the Markov chain.
prior
is a row matrix of dimension.
trans_mat
The transition matrix of the Markov chain.
trans_mat
is a matrix of dimension.
mask
Mask applied to the transition matrices
trans_mat
. By default, a mask of order one is applied.beta
Parameters of the polynomial regressions.
is a matrix of dimension
, with
p
the order of the polynomial regression.p
is fixed to 3 by default.sigma2
The variances for the
K
regimes. If HMMR model is heteroskedastic (variance_type = "heteroskedastic"
) thensigma2
is a matrix of size(otherwise HMMR model is homoskedastic (
variance_type = "homoskedastic"
) andsigma2
is a matrix of size).
nu
The degree of freedom of the HMMR model representing the complexity of the model.
phi
A 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
,beta
andsigma2
.If
try_algo = 1
thenbeta
andsigma2
are initialized by segmenting the time seriesY
uniformly intoK
contiguous segments. Otherwise,beta
andsigma2
are initialized by segmenting randomly the time seriesY
intoK
segments.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
statHMMR
of class StatHMMR (which contains the E-step).