StatMHMMR-class function

A Reference Class which contains statistics of a MHMMR model.

A Reference Class which contains statistics of a MHMMR model.

StatMHMMR contains all the statistics associated to a MHMMR

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.. class

Fields

  • tau_tk: Matrix of size (m,K)(m, K) giving the posterior probability that the observation YiY_{i} originates from the kk-th regression model.

  • alpha_tk: Matrix of size (m,K)(m, K) giving the forwards probabilities: c("P(Y1,dots,Yt,\nP(Y_{1},\\dots,Y_{t},\n", "zt=k) z_{t} = k)").

  • beta_tk: Matrix of size (m,K)(m, K), giving the backwards probabilities: P(Yt+1,,Ymzt=k)P(Y_{t+1},\dots,Y_{m} | z_{t} = k).

  • xi_tkl: Array of size (m1,K,K)(m - 1, K, K) giving the joint post probabilities: xitk[t,k,l]=P(zt=k,zt1=lY)xi_tk[t, k, l] = P(z_{t} = k, z_{t-1} = l | Y) for c("t\nt\n", "=2,dots,m = 2,\\dots,m").

  • f_tk: Matrix of size (m,K)(m, K) giving the cumulative distribution function f(ytzt=k)f(y_{t} | z_{t} = k).

  • log_f_tk: Matrix of size (m,K)(m, K) giving the logarithm of the cumulative distribution f_tk.

  • loglik: Numeric. Log-likelihood of the MHMMR model.

  • stored_loglik: Numeric vector. Stored values of the log-likelihood at each iteration of the EM algorithm.

  • klas: Column matrix of the labels issued from z_ik. Its elements are klas(i)=kklas(i) = k, k=1,,Kk = 1,\dots,K.

  • z_ik: Hard segmentation logical matrix of dimension (m,K)(m, K)

     obtained by the Maximum a posteriori (MAP) rule: c("$z_ik = 1 if z_ik = arg\n$", "$  max_s P(z_{i} = s | Y)  = tau_tk; 0 otherwise$"), $k = 1,\dots,K$.
    
  • state_probs: Matrix of size (m,K)(m, K) giving the distribution of the Markov chain. P(z1,,zm;π,A)P(z_{1},\dots,z_{m};\pi,A)

     with $\pi$ the prior probabilities (field `prior` of the class ParamMHMMR ) and $A$ the transition matrix (field `trans_mat` of the class ParamMHMMR ) of the Markov chain.
    
  • BIC: Numeric. Value of BIC (Bayesian Information Criterion).

  • AIC: Numeric. Value of AIC (Akaike Information Criterion).

  • regressors: Matrix of size (m,K)(m, K) giving the values of the estimated polynomial regression components.

  • predict_prob: Matrix of size (m,K)(m, K) giving the prediction probabilities: c("P(zt=k\nP(z_{t} = k |\n", "y1,dots,yt1) y_{1},\\dots,y_{t-1})").

  • predicted: Row matrix of size (m,1)(m, 1) giving the sum of the polynomial components weighted by the prediction probabilities predict_prob.

  • filter_prob: Matrix of size (m,K)(m, K) giving the filtering probabilities c("Pr(zt=k\nPr(z_{t} = k |\n", "y1,dots,yt) y_{1},\\dots,y_{t})").

  • filtered: Row matrix of size (m,1)(m, 1) giving the sum of the polynomial components weighted by the filtering probabilities.

  • smoothed_regressors: Matrix of size (m,K)(m, K) giving the polynomial components weighted by the posterior probability tau_tk.

  • smoothed: Row matrix of size (m,1)(m, 1) giving the sum of the polynomial components weighted by the posterior probability tau_tk.

Methods

  • computeLikelihood(paramMHMMR): Method to compute the log-likelihood based on some parameters given by the object paramMHMMR of class ParamMHMMR .

  • computeStats(paramMHMMR): Method used in the EM algorithm to compute statistics based on parameters provided by the object paramMHMMR of class ParamMHMMR .

  • EStep(paramMHMMR): Method used in the EM algorithm to update statistics based on parameters provided by the object paramMHMMR of class ParamMHMMR

     (prior and posterior probabilities).
    
  • MAP(): MAP calculates values of the fields z_ik and klas

     by applying the Maximum A Posteriori Bayes allocation rule.
     
      c("$z_ik = 1 if z_ik = arg max_s P(z_{i} = s | Y)  =\n$", "$      tau_tk; 0 otherwise$")
    

See Also

ParamMHMMR