ParamMixHMMR-class {flamingos} | R Documentation |
A Reference Class which contains parameters of a mixture of HMMR models.
Description
ParamMixHMMR contains all the parameters of a mixture of HMMR models.
Fields
fData
FData object representing the sample (covariates/inputs
X
and observed responses/outputsY
).K
The number of clusters (Number of HMMR models).
R
The number of regimes (HMMR components) for each cluster.
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.order_constraint
A logical indicating whether or not a mask of order one should be applied to the transition matrix of the Markov chain to provide ordered states. For the purpose of segmentation, it must be set to
TRUE
(which is the default value).alpha
Cluster weights. Matrix of dimension
(K, 1)
.prior
The prior probabilities of the Markov chains.
prior
is a matrix of dimension(R, K)
. The k-th column represents the prior distribution of the Markov chain asociated to the cluster k.trans_mat
The transition matrices of the Markov chains.
trans_mat
is an array of dimension(R, R, K)
.mask
Mask applied to the transition matrices
trans_mat
. By default, a mask of order one is applied.beta
Parameters of the polynomial regressions.
beta
is an array of dimension(p + 1, R, K)
, withp
the order of the polynomial regression.p
is fixed to 3 by default.sigma2
The variances for the
K
clusters. If MixHMMR model is heteroskedastic (variance_type = "heteroskedastic"
) thensigma2
is a matrix of size(R, K)
(otherwise MixHMMR model is homoskedastic (variance_type = "homoskedastic"
) andsigma2
is a matrix of sizenu
The degree of freedom of the MixHMMR model representing the complexity of the model.
phi
A list giving the regression design matrix for the polynomial regressions.
Methods
initParam(init_kmeans = TRUE, try_algo = 1)
Method to initialize parameters
alpha
,prior
,trans_mat
,beta
andsigma2
.If
init_kmeans = TRUE
then the curve partition is initialized by the K-means algorithm. Otherwise the curve partition is initialized randomly.If
try_algo = 1
thenbeta
andsigma2
are initialized by segmenting the time seriesY
uniformly intoR
contiguous segments. Otherwise,beta
andsigma2
are initialized by segmenting randomly the time seriesY
intoR
segments.initRegressionParam(Y, k, R, phi, variance_type, try_algo)
Initialize
beta
andsigma2
for the clusterk
.MStep(statMixHMMR)
Method which implements the M-step of the EM algorithm to learn the parameters of the MixHMMR model based on statistics provided by the object
statMixHMMR
of class StatMixHMMR (which contains the E-step).