run out-of-sample a MSVAR
res_oos=ms_var_oos(res_inp,endo,arg1,...,argn)
* res_inp = a 'ms var' results tlist
* 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)
* arg1,...,argn = optional arguments which can be:
- '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')
- 'dropna' if the user wants to remove the NA values from the data
* res_oos = a results tlist with:
- res_oos('meth') ='out of sample ms var'
- res_oos('typmod') = model numbered type
- res_oos('y') = a (T x K) matrix of original endogenous variables
- res_oos('ymat') = (T*K x 1) matrix of stacked endogenousvariables
- res_oos('xmat') = (T*K x sum(n_x)) matrix of switching exogenous variables
- res_oos('zmat') = the (T x M) matrix of -transformed- non switching regressors
- res_oos('switching V') = a scalar: - 1 if the variance does not switch with the states - M if the variance switches with the states
- res_oos('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_oos('nobs') = the # of observations
- res_oos('nendo') = the # of endogenous variables
- res_oos('nb_states') = the # of states
- res_oos('coeff') = the (np x 1) vector of parameters
- res_oos('llike') = the log-likekihood
- res_oos('grad') = the gradient at the solution
- res_oos('yhat') = the adjusted y
- res_oos('filtered resid') = the filtered residuals of the regression
- res_oos('dll') = the degrees of freedom
- res_oos('prob_st') = the (M x 1) vector of egodic state probabilities
- res_oos('ptrans') = the (M x M) matrix of transition probabilities
- res_oos('sigma') = the (M*M_V x M) variance-covariance matrix of the residuals
- res_oos('beta_id') = the (1 x sum(n_x)*M) vector of switching parameters
- res_oos('beta_co') = the (1 x sum(n_z)) vector of non switching parameters
- res_oos('inv_sigma') = the (K x K) inverse of the variance matrix
- res_oos('det_inv_sigma') = the determinant of the inverse of the variance matrix
- res_oos('filtered probs') = the (T x M) vector of filtered probabilities
- res_oos('smoothed probs') = the (T x M) vector of smoothed probabilities
- res_oos('n_x') = the (K x 1) vector of the numbers of switching exogenous variables for each endogenous variable
- res_oos('n_z') = the (K x 1) vector of the numbers of non switching exogenous variables for each endogenous variable
- res_oos('stderr') = the (np x 1) vector of coefficients standard errors
- res_oos('hes. delta') = the numerical increment for the calculation of the hessian matrix
- res_oos('tstat') = the (np x 1) vector of associated t-stats
- res_oos('pvalue') = the (np x 1) vector of associated p-values
- res_oos('covbeta') = the (np x np) variance-covariance matrix of the parameters
- res_oos('corbeta') = the (np x np) correlation matrix of the parameters
- res_oos('ptrans_tstat') = the (M x 1) vector of t-stats for the transition probabilities
- res_oos('beta_id_tstat') = the (1 x n_x*K*M) vector of t-stats for switching parameters
- res_oos('beta_co_tstat') = the (1 x n_z*K) vector of t-stats for non switching parameters
- res_oos('sigma_tstat') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals
- res_oos('ptrans_pvalue') = the (M x M) matrix of t-stats for transition probabilities
- res_oos('beta_id_pvalue') = the (1 x n_x*K*M) vector of t-stats for switching parameters
- res_oos('beta_co_pvalue') = the (1 x n_z*K) vector of t-stats for non switching parameters
- res_oos('sigma_pvalue') = the (M*M_V x M) matrix of t-stats for the variance-covariance matrix of the residuals
- res_oos('smoothed resid') = the smoothed residuals of the regression
- res_oos('namey') = the (ny x 1) vector of names of the endogenous variables
- res_oos('namex_id') = the (n_x x 1) vector of names of the switching exogenous variables
- res_oos('namex_co') = the (n_x x 1) vector of names of the non switching exogenous variables
- res_oos('apriori') = a scalar - 0 if there is no a priori datation - 1 if there is an a priori datation
- res_oos('prests') = a boolean indicating whether there are ts in the regression
- res_oos('prests') = a boolean indicating whether there are ts in the regression
- res_oos('datation') = the a priori datation if any
- res_oos('namedat') = the name of the series used for an a priori datation if any
- res_oos('bounds') = the bounds if there are ts in the regression
- res_oos('dropna') = boolean indicating if NAs have been dropped
- res_oos('nonna') = vector indicating position of non-NA values (if the option 'dropna' was active)
global GROCERDIR; load(GROCERDIR+'\data\us_revu.dat') bounds('1967m4','2002m12') nb_states=2 switch_var=2 // variances are switching var_opt=3 // heteroskedastik var-cov matrix r=ms_var('const',3,'100*(log(us_revu)-lagts(2,log(us_revu)))',nb_states,switch_var,var_opt,'prt=initial;final','transf=stud') bounds('2002m12','2004m3') roos=ms_var_oos(r,'100*(log(us_revu)-lagts(2,log(us_revu)))') // the ms_var result stored in tlist r is run on the (out-of-) sample '2002m12' to '2004m3' | ![]() | ![]() |