%modelpoke

Use this forum to post questions about syntax problems or general programming issues. Questions on implementing a particular aspect of econometrics should go in "Econometrics Issues" below.
Finn Weiss
Posts: 15
Joined: Fri Apr 24, 2015 8:48 am

%modelpoke

Unread post 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?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: %modelpoke

Unread post by TomDoan »

Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: %modelpoke

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: %modelpoke

Unread post 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.
Jules89
Posts: 140
Joined: Thu Jul 14, 2016 5:32 am

Re: %modelpoke

Unread post 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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: %modelpoke

Unread post 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.
Post Reply