ParamRHLP-class {samurais} | R Documentation |
A Reference Class which contains parameters of a RHLP model.
Description
ParamRHLP contains all the parameters of a RHLP 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
x_{1},\dots,x_{m}
.Y
Numeric vector of length m representing the observed response/output
y_{1},\dots,y_{m}
.m
Numeric. Length of the response/output vector
Y
.K
The number of regimes (RHLP components).
p
The order of the polynomial regression.
q
The dimension of the logistic regression. For the purpose of segmentation, it must be set to 1.
variance_type
Character indicating if the model is homoskedastic (
variance_type = "homoskedastic"
) or heteroskedastic (variance_type = "heteroskedastic"
). By default the model is heteroskedastic.W
Parameters of the logistic process.
\boldsymbol{W} = (\boldsymbol{w}_{1},\dots,\boldsymbol{w}_{K-1})
is a matrix of dimension(q + 1, K - 1)
, withq
the order of the logistic regression.q
is fixed to 1 by default.beta
Parameters of the polynomial regressions.
\boldsymbol{\beta} = (\boldsymbol{\beta}_{1},\dots,\boldsymbol{\beta}_{K})
is a matrix of dimension(p + 1, K)
, withp
the order of the polynomial regression.p
is fixed to 3 by default.sigma2
The variances for the
K
regimes. If RHLP model is heteroskedastic (variance_type = "heteroskedastic"
) thensigma2
is a matrix of size(K, 1)
(otherwise RHLP model is homoskedastic (variance_type = "homoskedastic"
) andsigma2
is a matrix of size(1, 1)
).nu
The degree of freedom of the RHLP 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
W
,beta
andsigma2
.If
try_algo = 1
thenbeta
andsigma2
are initialized by segmenting the time seriesY
uniformly intoK
contiguous segments. Otherwise,W
,beta
andsigma2
are initialized by segmenting randomly the time seriesY
intoK
segments.MStep(statRHLP, verbose_IRLS)
Method which implements the M-step of the EM algorithm to learn the parameters of the RHLP model based on statistics provided by the object
statRHLP
of class StatRHLP (which contains the E-step).