1 Introduction
TVP-VAR(Time-VaryingParameter Vector AutoRegression) is the package for a Bayesian analysis of thetime-varying parameter VAR models. It implements the Markov chain Monte Carlo(MCMC) algorithm to generate sample from the posterior distribution of theTVP-VAR models.
2 Model formulation andcreating objects
3俺参照编写的第一个code/*** MCMC estimation for Time-Varying ParameterVAR model** with stochastic volatility** ** tvpvar_ex*.ox illustrates the MCMC estimation** using TVP-VAR class** writing by Chao Zhou** My qq number is 529820052** E-mail:gssdzc@126.com** For my first TVP-VAR model** For my working paper about LiKeQiangindex */ #include<oxstd.h>#include<oxprob.h>#include<oxfloat.h>#include<oxdraw.h>#include<TVPVAR.ox> //TVP-VAR class main(){ decl nlag, my, asvar, iyear, iperiod,ifreq; nlag = 2; //#of lag /*--- data load ---*/ my = loadmat("tvpvar_ex.xls"); //data /*--- some options (not required) ---*/ asvar = {"p", "x","i"}; //variable name iyear = 1977; //year of the first observation iperiod = 3; //period of the first observation ifreq = 4; //frequency of data //(periods ineach year) /*--- MCMC estimation ---*/ decl tvpvar = new TVPVAR();//TVP-VARclass tvpvar.SetRanseed(3); tvpvar.SetData(my, nlag); //set data and lag tvpvar.SetVarName(asvar); //set variable name(*) tvpvar.SetPeriod(iyear, iperiod, ifreq); //setinitial period(*) tvpvar.SetFastImp(1); //set fast computing of //impulseresponse(*) tvpvar.MCMC(10000); //MCMC estimation tvpvar.DrawImp(<4, 8, 12>, 1); //draw impulse(1) //trajectories of (4,8,12)-period horizon tvpvar.DrawImp(<30, 70, 100>, 0); //draw impulse(2) //response at t = 30, 70, 100 delete tvpvar;}/***(*): options, not required for estimation*/ // enter code