程序运行有一定的步骤与顺序
importing data
setting parameters:
number of endogenous variables
number of regime
order of the VAR
......
estimation
{parameter,...}=MSVAR_Estimate(y_mat,x_mat,z_mat);
Filtering
{prob_st_res, ptrans_res,...}=MSVAR_PrintParameter(parameter);
{LIKV, y_hat, resid,lpr, PR_STT, PR_STL} = MSVAR_Filt(parameter);
smoothing
PR_SMO=MSVAR_smooth(PR_STT,pr_STL,ptrans_res);
Residual analysis and diagnostics
JB_stat=MSVAR_JarqBera(resid,cols(parameter));
假设model diagnostics没有通过
你就必须回头重设parameters再试.
其实gauss区块,有很丰富的资源
hamilton,kim,Bellone代码都有
值得你好好研读体会,自然不会有困惑