全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Gauss专版
12882 26
2012-04-10
悬赏 200 个论坛币 已解决
在MSVARLIB中的数据文件最后两列是什么?看起来是区制分类,但是至于数据是属于哪个区制不是软件迭代出来的吗?但如果把最后两列给改为0或者删除就无法运行了,求助高手,如果用自己的数据要怎样解决这个问题?

最佳答案

epoh 查看完整内容

/*请自行先把数据处理好*/ month year x y 1 1960 123 321 1 1961 234 456 ....... .......100 obs save as xyvar.txt /*************/ _ncol=4; /* _ncol=_K+2 : month and year + number of series */ Data_init_file="xyvar"; data_set = MSVAR_load(Data_init_file,_ncol); Nb_rows=rows(data_set); _K=2; _M=2; _M_V=1; /* _M_V=1 : no switch in variance or _ ...
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2012-4-10 16:52:57
ferguson06 发表于 2012-4-11 16:15
我是两个变量,2个区制,滞后一阶想用截距均值模型做,年度数据
除了数据输入这边改,还需要在choosing  ...
/*请自行先把数据处理好*/
month year   x    y
1    1960  123  321
1    1961  234  456
.......
.......100 obs
save as xyvar.txt
/*************/
_ncol=4;     /* _ncol=_K+2  : month and year + number of series */
Data_init_file="xyvar";              

data_set =  MSVAR_load(Data_init_file,_ncol);
Nb_rows=rows(data_set);

_K=2;
_M=2;
_M_V=1;  /*  _M_V=1 : no switch in variance  or _MV_=_M : switch in variance  */
_Var_opt=1;
_typmod=3;
_p=1;          /*  degree of the MSVAR(p)  for p>=1 if under construction */

_n_x=1;        /* number of exogenous, switching variables (including intercept) _n_x=1 by default for the model 1 */
_n_z=1;        /* number of exogenous, non-switching variables (including intercept) _n_z=1 by default for the model 1 */

/*请自行先把数据处理好*/
F_option=0;
k_lag=0;
d_option=0;


/* ==========Start and ending index  =========== */
deb=1;
fin=100;

_apriori=0;
date_col=4;  
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-4-10 20:45:25
有没有人知道的啊?现在论文比较急,大家帮帮忙~~
我后来又看了看源程序,最后两列貌似不是区制,而是外生变量,但不懂为什么都是1/2/3这样的数字,如果用自己的数据又要怎么设置呢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-4-11 13:32:05
1        1960        0.19        41        30.13        .        2        2
2        1960        0.21        41        29.86        .        2        2
3        1960        0.19        39        29.59        .        2        2
4        1960        0.19        38        29.36        .        1        1
5        1960        0.2        38        29.32        .        1        1
6        1960        0.19        37        28.95        .        1        1
7        1960        0.18        36        28.85        .        1        1
8        1960        0.18        35        28.82        .        1        1
9        1960        0.18        34        28.52        .        1        1
10        1960        0.16        32        28.48        .        1        1
11        1960        0.16        32        28.08        .        1        1
12        1960        0.15        30        27.55        .        1        1
1        1961        0.15        30        27.58        .        1        1
2        1961        0.14        30        27.55        .        1        1
3        1961        0.14        30        27.71        .        2        2
4        1961        0.14        30        28.28        .        2        2
5        1961        0.14        32        28.72        .        2        3
6        1961        0.14        32        29.12        .        2        3
7        1961        0.14        33        29.46        .        2        3
这是楼主所问的问题,为何最后两列是1/2/3 同问。
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-4-11 15:19:44
liying0782 发表于 2012-4-10 20:45
有没有人知道的啊?现在论文比较急,大家帮帮忙~~
我后来又看了看源程序,最后两列貌似不是区制,而是外生 ...
7            8
NBER        Three_state
2        2
2        2
2        2
1        1
1        1
1        1
1        1
1        1
1        1
1        1
1        1
1        1
1        1
1        1
2        2
2        2
2        3
2        3
2        3
....
....
就是MSVARlib_data,sheet ref_date
NBER datations ,
REC4 Three state datation - recoded
  1        Recessionary regime
  2        intermediate
  3        High growth

自己的数据,可以不用这两个columns
Datation NBER,画图时可以比较模型的准确性
如MSVARlib-v2.0.pdf page 11/27,figure 3

二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2012-4-11 16:10:49
epoh 发表于 2012-4-11 15:19
7            8
NBER        Three_state
2        2
epoh老师你好
  你意思就是说如果是我用自己的数据运行MSVAR,数据只要按如下格式写就好了?
1960 123 321
1961 234 456
......
那么在主程序里面的
/*=======================================================================================================*/
/*                                   Loading  Data  of input file
*
* Caution : the file should include the series following this order  :
* month /year / y series  / X series / z series / refdate (optional ) , see MSVARlibdata.xls, for template examples.       
*
* Do not include intercept or lagged series in your input file this is fixed in MSVAR_setsample
* No missing value are allowed
*
*/
/*=======================================================================================================*/


/*=============================================================*/

_ncol=5;                                 /* _ncol=_K+2  : month and year + number of series */Data_init_file="MSVARUN";              /* ch鬽age and help wanted */

/*=========== Data_init_file = y_mat (.,_K)~x_mat(.,_n_x)~z_mat(.,_n_z) ===================*/

data_set =  MSVAR_load(Data_init_file,_ncol);
Nb_rows=rows(data_set);
有什么是需要改的吗?我红字注释的地方是不是全了?
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

点击查看更多内容…
相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群