ms_estimate — Markvov Switching regression model
res=ms_estimate(y,x,z,transf,MS_typmod,MS_M,MS_M_V,MS_var_opt,MS_apriori,prt)
y = (T x K) matrix of endogenous variables
x = (T x n_x) matrix of switching exogenous variables
z = (T x n_x) matrix of non switching exogenous variables
z = (T x n_x) matrix of non switching exogenous variables
transf = the way data are transformed for the estimation:
- 'none' if there is no transformation
- 'dem' if the data are demeaned
- 'stu' if the data are studentized
MS_typmod= type of MS model
- 1: mean-variance switching model
- 2: MS VAR regime dependent model
- 3: MS VAR intercept regime dependent model
- 4: partially regime dependent MS regression model
- 5: regime dependent MS regression model
MS_M = a scalar equal the # of states
MS_V = a scalar:
- 1 if the variance of the residuals is the same for all states
- MS_M if the variance of the residuals differs among the states
MS_var_opt = a scalar:
- 1 if the variance of residuals is heteroskedastic
- 2 if the variance of residuals is homoskedastic
- 3 if the variance of residuals is unconstrained
MS_apriori =
- 0 if there is no a priori datation
- 1 if there is an priori datation
prt = %t if the initial values of the parameters are to be printed
r = a results tlist with:
- r('meth') = model literal type ('ms mean' 'ms var' or 'ms regression')
- r('typmod') = model numbered type
- r('y') = a (N x M) matrix of original endogenous variables
- r('x') = the (N x n_x) matrix of exogenous switching regressors
- r('z') = the (N x n_z) matrix of exogenous non switching regressors
- r('ymat') = the (N x M) matrix of -transformed- endogenous variables
- r('xmat') = the (N x n_x) matrix of -transformed- exogenous switching regressors
- r('zmat') = the (N x n_z) matrix of -transformed- non switching regressors
- r('switching V') = a scalar:
- 1 if the variance does not switch with the states
- M if the variance switches with the states
- r('var_opt') = a scalar:
- 1 if the variance of residuals is heteroskedastic
- 2 if the variance of residuals is homoskedastic
- 3 if the variance of residuals is unconstrained
- r('nobs') = the # if observations
- r('nendo') = the # of endogenous variables
- r('nb_states') = the # of states
- r('coeff') = the (np x 1) vector of parameters
- r('llike') = the log-likekihood
- r('grad') = the gradient at the solution
- r('yhat') = the adjusted y
- r('resid') = the residuals of the regression
- r('dll') = the degrees of freedom
- r('prob_st') = the (M x 1) vector of egodic state probabilities
- r('ptrans') = the (M x M) matrix of transition probabilities
- r('sigma') = the (M*M_V x M) variance-covariance matrix of the residuals
- r('beta_id') = the (1 x n_x*K*M) vector of switching parameters
- r('beta_co') = the (1 x n_z*K) vector of non switching parameters
- r('inv_sigma') = the (K x K) inverse of the variance matrix
- r('det_inv_sigma') = the determinant of the inverse of the variance matrix
- r('smoothed probs') = the (T x M) vector of smoothed probabilities
- r('stderr') = the (np x 1) vector of coefficients standard errors
- r('tstat') = the (np x 1) vector of associated t-stats
- r('pvalue') = the (np x 1) vector of associated p-values
- r('covbeta') = the (np x np) variance-covariance matrix of the parameters
- r('corbeta') = the (np x np) correlation matrix of the parameters
- r('ptrans_tstat') = the (M x 1) vector of t-stats for the transition probabilities
- r('beta_id_tstat') = the (1 x n_x*K*M) vector of t-stats for switching parameters
- r('beta_co_tstat') = the (1 x n_z*K) vector of t-stats for non switching parameters
- r('sigma_tstat') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals
- r('ptrans_pvalue') = the (M x M) matrix of t-stats for transition probabilities
- r('beta_id_pvalue') = the (1 x n_x*K*M) vector of t-stats for switching parameters
- r('beta_co_pvalue') = the (1 x n_z*K) vector of t-stats for non switching parameters
- r('sigma_pvalue') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals