| StatHMMR-class {samurais} | R Documentation |
A Reference Class which contains statistics of a HMMR model.
Description
StatHMMR contains all the statistics associated to a HMMR model. It mainly includes the E-Step of the EM algorithm calculating the posterior distribution of the hidden variables (ie the smoothing probabilities), as well as the calculation of the prediction and filtering probabilities, the log-likelhood at each step of the algorithm and the obtained values of model selection criteria..
Fields
tau_tkMatrix of size
(m, K)giving the posterior probability that the observationY_{i}originates from thek-th regression model.alpha_tkMatrix of size
(m, K)giving the forwards probabilities:P(Y_{1},\dots,Y_{t}, z_{t} = k).beta_tkMatrix of size
(m, K), giving the backwards probabilities:P(Y_{t+1},\dots,Y_{m} | z_{t} = k).xi_tklArray of size
(m - 1, K, K)giving the joint post probabilities:xi_tk[t, k, l] = P(z_{t} = k, z_{t-1} = l | \boldsymbol{Y})fort = 2,\dots,m.f_tkMatrix of size
(m, K)giving the cumulative distribution functionf(y_{t} | z{_t} = k).log_f_tkMatrix of size
(m, K)giving the logarithm of the cumulative distributionf_tk.loglikNumeric. Log-likelihood of the HMMR model.
stored_loglikNumeric vector. Stored values of the log-likelihood at each iteration of the EM algorithm.
klasColumn matrix of the labels issued from
z_ik. Its elements areklas(i) = k,k = 1,\dots,K.z_ikHard segmentation logical matrix of dimension
(m, K)obtained by the Maximum a posteriori (MAP) rule:z\_ik = 1 \ \textrm{if} \ z\_ik = \textrm{arg} \ \textrm{max}_{s} \ P(z_{i} = s | \boldsymbol{Y}) = tau\_tk;\ 0 \ \textrm{otherwise},k = 1,\dots,K.state_probsMatrix of size
(m, K)giving the distribution of the Markov chain.P(z_{1},\dots,z_{m};\pi,\boldsymbol{A})with\pithe prior probabilities (fieldpriorof the class ParamHMMR) and\boldsymbol{A}the transition matrix (fieldtrans_matof the class ParamHMMR) of the Markov chain.BICNumeric. Value of BIC (Bayesian Information Criterion).
AICNumeric. Value of AIC (Akaike Information Criterion).
regressorsMatrix of size
(m, K)giving the values of the estimated polynomial regression components.predict_probMatrix of size
(m, K)giving the prediction probabilities:P(z_{t} = k | y_{1},\dots,y_{t-1}).predictedRow matrix of size
(m, 1)giving the sum of the polynomial components weighted by the prediction probabilitiespredict_prob.filter_probMatrix of size
(m, K)giving the filtering probabilitiesPr(z_{t} = k | y_{1},\dots,y_{t}).filteredRow matrix of size
(m, 1)giving the sum of the polynomial components weighted by the filtering probabilities.smoothed_regressorsMatrix of size
(m, K)giving the polynomial components weighted by the posterior probabilitytau_tk.smoothedRow matrix of size
(m, 1)giving the sum of the polynomial components weighted by the posterior probabilitytau_tk.
Methods
computeLikelihood(paramHMMR)Method to compute the log-likelihood based on some parameters given by the object
paramHMMRof class ParamHMMR.computeStats(paramHMMR)Method used in the EM algorithm to compute statistics based on parameters provided by the object
paramHMMRof class ParamHMMR.EStep(paramHMMR)Method used in the EM algorithm to update statistics based on parameters provided by the object
paramHMMRof class ParamHMMR (prior and posterior probabilities).MAP()MAP calculates values of the fields
z_ikandklasby applying the Maximum A Posteriori Bayes allocation rule.z\_ik = 1 \ \textrm{if} \ z\_ik = \textrm{arg} \ \textrm{max}_{s} \ P(z_{i} = s | \boldsymbol{Y}) = tau\_tk;\ 0 \ \textrm{otherwise}