| 所在主题: | |
| 文件名: data.dta | |
| 资料下载链接地址: https://bbs.pinggu.org/a-2921862.html | |
| 附件大小: | |
|
我做的是空间状态模型预测结合State space in Stata.pdf来做的,但是出现了一点问题。
原始数据如下: 代码如下 [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 = 1sspace (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 D1predict trend, state equation(trend)predict res, residualslocal 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 REStsappend, 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()函数更本不能运行出结果,大佬帮帮忙啊 小萌新上路翻车了 |
|
熟悉论坛请点击新手指南
|
|
| 下载说明 | |
|
1、论坛支持迅雷和网际快车等p2p多线程软件下载,请在上面选择下载通道单击右健下载即可。 2、论坛会定期自动批量更新下载地址,所以请不要浪费时间盗链论坛资源,盗链地址会很快失效。 3、本站为非盈利性质的学术交流网站,鼓励和保护原创作品,拒绝未经版权人许可的上传行为。本站如接到版权人发出的合格侵权通知,将积极的采取必要措施;同时,本站也将在技术手段和能力范围内,履行版权保护的注意义务。 (如有侵权,欢迎举报) |
|
京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明