Page 1 of 1

%modelpoke

Posted: Tue Mar 06, 2018 9:30 am
by Finn Weiss
Hey,

i want to use the function %modelpoke to replace equation i with another equation. But this function does not seem to work correctly.The function changes the equations but it also deletes the i+1 to n-th equations of the model.

So didn't i understand the function or does the function work incorrect?

Re: %modelpoke

Posted: Wed Mar 28, 2018 11:09 pm
by TomDoan

Re: %modelpoke

Posted: Tue Mar 05, 2019 2:04 am
by Jules89
Dear Tom,

after I have replaced an equation in a model with the %modelpoke() function, how do I get the resulting covariance matrix of that model
?


Thanks

Jules

Re: %modelpoke

Posted: Tue Mar 05, 2019 4:10 pm
by TomDoan
Unless it's a known transformation of the existing covariance matrix (due to being a linear transformation of the equations), you would have to recompute the residuals (of all the equations) and use VCV to compute a new covariance matrix. If it's a known transformation, you could do a matrix calculation, but nothing is going to be done automatically.

Re: %modelpoke

Posted: Wed Mar 06, 2019 6:35 am
by Jules89
Thanks! I have a followup question:

I estimated a model and used in the ESTIMATE instruction the SMPL option with a dummy variable to estimate the model for some regime specific periods, then I replaced the first equation of the model with some other equation:

Code: Select all

estimate(print,smpl=dup,model=sur,title="Upper Regime",resid=resup) rstart rend                                     
compute %modelpoke(sur,1,%modeleqn(exovar,1))
Then I want to calculate the resudals of that new model, so I did the following:

Code: Select all

smpl(series =(dup>0))
forecast(model=sur,errors=resup,static)
But then I get this error:

## SR5. Using Range 0 to 0 of Series x1. (Incorrect start,end or SMPL)

So hwo do I get the residuals of the new model where I have replaced the equation, when the residuals should only be calculated for the subset defined above.



Best

Jules

Re: %modelpoke

Posted: Wed Mar 06, 2019 10:24 am
by TomDoan
SMPL options don't apply to FORECAST---you can always ignore forecasts that you don't want. It will take the overall range off the SMPL instruction, but you should probably just use FROM and TO options on the FORECAST instruction instead.