全部版块 我的主页
论坛 提问 悬赏 求职 新闻 读书 功能一区 经管百科 爱问频道
797 2
2019-09-08
我做的是空间状态模型预测结合State space in Stata.pdf来做的,但是出现了一点问题。
原始数据如下:
data.dta
大小:(91.92 KB)

 马上下载


代码如下

[LaTex]tsset t   *趋势 constraint 1 [trend]L.trend = 1 constraint 2 [trend]L.slope = 1 constraint 3 [slope]L.slope = 1 constraint 4 [Y]A = 1 constraint 5 [Y]B = 1 constraint 6 [Y]C = 1 constraint 7 [Y]trend = 1  sspace (trend L.trend L.slope, state noconstant)(slope L.slope, state noerror noconstant)(Y A B C trend,noconstant), constraints(1/7) covstate(diagonal)  predict D1  predict trend, state equation(trend)  predict res, residuals  local n = floor(3*_N/4)  generate int q = quarter(t)        twoway (scatter Y t in `n'/L, msymbol(none) mlabel(q) mlabposition(0) ytitle(上感) ylabel(#3)) (tsline D1 trend in `n'/L), nodraw name(G1)  tsline res in `n'/L, nodraw name(RES) yline(0)  graph combine G1 RES, name(G2) rows(2)  graph drop G1 RES  tsappend, add(60)  predict D1, dynamic(td(12apr2018)) rmse(rftp)  scalar z = invnormal(0.95)  gen lb = D2 + z*rftp if t>=td(11apr2018)  gen ub = D2 - z*rftp if t>=td(11apr2018)  tsline D2 if t>=td(11apr2018) || tsrline lb ub if t>=td(11apr2018),xline(`=td(11apr2018)') legend(label(2 "90 \% CI")) name(DYN)[/LaTex]
问题在于我的dynamic()函数更本不能运行出结果,大佬帮帮忙啊   小萌新上路翻车了


二维码

扫码加我 拉你入群

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

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

全部回复
2019-9-8 13:19:29
大佬帮帮忙啊!
二维码

扫码加我 拉你入群

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

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

2019-9-8 13:19:48
在线等  急!!!
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

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