<< ms_forecast Markov-switching models ms_mean_oos >>

Grocer >> Markov-switching models > ms_mean

ms_mean

Markov Switching mean-variance model

CALLING SEQUENCE

res=ms_mean(endo,MS_M,MS_M_V,MS_var_opt,arg1,...,argn)

PARAMETERS

Input

* endo =

   - (T x K) string matrix of endogenous variables

   or:

   - a list containing all the endogenous variables in any of the following form:

     .a time series

     . a real matrix

     . a string representing such objects

     . the string 'const' (for the constant variable)

* 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

* arg1,... argn = optional arguments which can be:

  - 'datation=xx' where xx is the name of a series used as an a priori datation (default: no a priori datation)

  - 'transf=xx' where xx is either 'dem' if the user wants all series to be demeaned or 'stu' if the user wants all series to be studentized (default: no transformation)

  - 'gdelta=xx' where xx is a number used to calculate the numerical derivative of the log-likelihood (default 1e-4)

  - 'hdelta=xx' where xx is a number used to calculate the numerical hessian (default 1e-5)

  - 'prt=xx' where xx='nothing', 'final', 'all' or ['initial';'final'] if the user wants to print nothing, only the final results or the final and the initial results

  - 'noprint' if the user wants to print nothing (equivalent to 'prt=nothing')

  - the string 'dropna' if the user wants to remove the NA values from the data

  - 'init_beta_id = xxx' where xxx is a vector of starting values for the switching exogenous variables

  - 'init_prob' = xxx' where xxx is a matrix of starting values for the transition probabilities

  - 'init_var' = xxx' where xxx is a matrix of starting values for the variances

  - 'notstat' if the user does not want to calculate the Student statistics of the parameters

  - 'optfunc=optim' if the user wants to use the optim optimisation function (default: optimg)

  - 'opt_nelmead=crit,nitermax' with crit the value of the convergence criterion in the Nelder-Meade optimisation function and nitermax the maximum number of iterations (default = 'opt_nelmead=2*%eps,1000')

  - 'opt_optim=opts' where opts are options for optim that can be entered after the starting value of the parameters (default = 'opt_optim=,''ar'',1e6,1e6'')

  - 'opt_convg=val' where val is the threshold on gradient norm (default = 'opt_convg=1e-5')

 

Output

* res = a results tlist with:

  - res('meth') = model literal type ('ms mean' 'ms var' or 'ms regression')

  - res('typmod') = model numbered type

  - res('y') = a (T x K) matrix of original endogenous variables

  - res('ymat') = (T*K x 1) matrix of stacked endogenous variables

  - res('xmat') = (T*K x sum(n_x)) matrix of switching exogenous variables

  - res('zmat') = (T*K x sum(n_z)) matrix of non switching exogenous variables

  - res('switching V') = a scalar:

     . 1 if the variance does not switch with the states

     . M if the variance switches with the states

  - res('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

  - res('nobs') = the # if observations

  - res('nendo') = the # of endogenous variables

  - res('nb_states') = the # of states

  - res('coeff') = the (np x 1) vector of parameters

  - res('llike') = the log-likekihood

  - res('grad') = the gradient at the solution

  - res('yhat') = the adjusted y

  - res('filtered resid') = the filtered residuals of the regression

  - res('dll') = the degrees of freedom

  - res('prob_st') = the (M x 1) vector of egodic state probabilities

  - res('ptrans') = the (M x M) matrix of transition probabilities

  - res('sigma') = the (M*M_V x M) variance-covariance matrix of the residuals

  - res('beta_id') = the (1 x sum(n_x)*M) vector of switching parameters

  - res('beta_co') = the (1 x sum(n_z)) vector of non switching parameters

  - res('inv_sigma') = the (K x K) inverse of the variance matrix

  - res('det_inv_sigma') = the determinant of the inverse of the variance matrix

  - res('filtered probs') = the (T x M) vector of filtered probabilities

  - res('smoothed probs') = the (T x M) vector of smoothed probabilities

  - res('n_x') = the (K x 1) vector of the numbers of switching exogenous variables for each endogenous variable

  - res('n_z') = the (K x 1) vector of the numbers of non switching exogenous variables for each endogenous variable

  - res('stderr') = the (np x 1) vector of coefficients standard errors

  - res('hes. delta') = the numerical increment for the calculation of the hessian matrix

  - res('tstat') = the (np x 1) vector of associated t-stats

  - res('pvalue') = the (np x 1) vector of associated p-values

  - res('covbeta') = the (np x np) variance-covariance matrix of the parameters

  - res('corbeta') = the (np x np) correlation matrix of the parameters

  - res('ptrans_tstat') = the (M x 1) vector of t-stats for the transition probabilities

  - res('beta_id_tstat') = the (1 x n_x*K*M) vector of t-stats for switching parameters

  - res('beta_co_tstat') = the (1 x n_z*K) vector of t-stats for non switching parameters

  - res('sigma_tstat') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals

  - res('ptrans_pvalue') = the (M x M) matrix of t-stats for transition probabilities

  - res('beta_id_pvalue') = the (1 x n_x*K*M) vector of t-stats for switching parameters

  - res('beta_co_pvalue') = the (1 x n_z*K) vector of t-stats for non switching parameters

  - res('sigma_pvalue') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals

  - res('smoothed resid') = the smoothed residuals of the regression

  - res('namey') = the (n_y x 1) vector of names of the endogenous variables

  - res('namex_id') = the name of the swicthing exogenous variables = 'cte'

  - res('namex_co') = the [] vector of names of the non swicthing exogenous variables

  - res('apriori') = a scalar

     . 0 if there is no a priori datation

     . 1 if there is an a priori datation

  - res('prests') = a boolean indicating whether there is are ts in the regression

  - res('datation') = the a priori datation if any

  - res('namedat') = the name of the series used for an a priori datation if any

  - res('dropna') = boolean indicating if NAs have been dropped

  - res('bounds') = if there is a timeseries in the forecast, the bounds of the regression

  - res('nonna') = vector indicating position of non-NAs

DESCRIPTION

Estimates a Markvov Switching (MS) mean-variance model by the maximum likelihood method.

EXAMPLE

load('C:\SCI\macros\grocer\db\anas.dat')
bounds('1984m2','2003m1')
nb_states=3
switch_var=1
var_opt=1
r=ms_mean(['delts(log(construc))';'delts(log(ipi))';'delts(log(helpwanted))';'delts(log(revu))'],nb_states,switch_var,var_opt,'transf=stud','datation=datation_bb')
// This example is taken from function ms_mean_d.
// The endogenous variables are 'delts(log(construc))', 'delts(log(ipi))', 'delts(log(helpwanted))' and 'delts(log(revu))'.
// There are 3 states, the variances are not switching (switch_var=1) and the var-cov matrix is heteroskedastic (var_opt=1).
// Two optional arguments have been given: 'transf= stud' which means that variables are studentuzed before estimation
// and 'datation=datation_bb' which means that the an priori datation (provided by Benoit Bellone) is given.

AUTHOR

Benoit Bellone/Eric Dubois 2006

Report an issue
<< ms_forecast Markov-switching models ms_mean_oos >>