Hello, I have tried running a code given to me to predict a pseudo out-of-sample forecast using a loop of autoregression, but I only get syntax error. I suspect I must download an extension or something, but I'm not sure. I would appreciate any help!
Here's my code:
local start = tq(2003q1)
local end = tq(2012q4)
gen forecast = .
forvalues i = `start'/`end' {
* AR(2) regression ;
reg d_infl L(1/2).d_infl if quarter >= tq(1963q1) & quarter <=`i', robust
* forecast for the next period ;
replace forecast = _b[_cons] + _b[L1.d_infl]*L1.d_infl+ _b[L2.d_infl]*L2.d_infl if quarter == `i' + 1 ;
}
Related Posts with Pseudo out-of-sample forecast using loops
Python Dictionary (I think) to dataframeHey everyone. To anyone who may use Python... A coworker and I wish to obtain some trade data from U…
Requesting feedback on set-up of a time to event analysis with Andersen Gill methodHi there, I would like to perform a time to event analysis of hospital readmissions by patient usin…
Invalid syntax when trying break the line of codesHi all experts, Today I try to break a long code to multiple lines but Iface the same errors and I …
Is that possible to output correlation coefficient above a cutoff?For example, output the coefficient above .7 to a table, can we do this? can command estout do this?…
very large integers - precision beyond double storage typeHi there I understand that there are limits on the precision of storage types, with 'double' offerin…
Subscribe to:
Post Comments (Atom)
0 Response to Pseudo out-of-sample forecast using loops
Post a Comment