Reestimate equation with different sample without specifying it again
Moderators: EViews Gareth, EViews Jason, EViews Moderator
Reestimate equation with different sample without specifying it again
Hey,
my question is very easy. At the beginning I specify an equation. I want to do "realtime fitting", i.e. calculate the fitted values based on the estimation of data up to this point. Is there a way to reestimate an already existing equation (with a different sample) without specifying it again?
Let's say I have data from 1970 to 2010. I want to to "realtime fitting" for the period 1990 to 2010. In a loop I start with the estimation of the model based on data from 1970 to 1990 and then I save the fitted values for 1990. In the next step I do this again for 1991. As far as I see I have to specify the equation each time I want to estimate it. Is there a way to just reestimate it for a different sample (something like equation_name.update)? I've already looked in the command reference, but haven't found anything that helps.
Thanks in advance!
Best,
Thomas
my question is very easy. At the beginning I specify an equation. I want to do "realtime fitting", i.e. calculate the fitted values based on the estimation of data up to this point. Is there a way to reestimate an already existing equation (with a different sample) without specifying it again?
Let's say I have data from 1970 to 2010. I want to to "realtime fitting" for the period 1990 to 2010. In a loop I start with the estimation of the model based on data from 1970 to 1990 and then I save the fitted values for 1990. In the next step I do this again for 1991. As far as I see I have to specify the equation each time I want to estimate it. Is there a way to just reestimate it for a different sample (something like equation_name.update)? I've already looked in the command reference, but haven't found anything that helps.
Thanks in advance!
Best,
Thomas

 EViews Developer
 Posts: 262
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Reestimate equation with different sample without specifying it again
Hello,
An equation object stores its own specification, which you can access to reestimate the equation without explicitly respecifying it:
You'd need to set the new sample before the above code, as the above implicitly uses the current workfile sample.
An equation object stores its own specification, which you can access to reestimate the equation without explicitly respecifying it:
Code: Select all
%com = eq.@command
eq.{%com}
You'd need to set the new sample before the above code, as the above implicitly uses the current workfile sample.

 EViews Developer
 Posts: 262
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Reestimate equation with different sample without specifying it again
Just learned from EViews Gareth that there's a currently undocumented reestimate proc for equations. The following reestimates an equation with its original sample.
The following reestimates an equation with the provided <sample spec>.
Code: Select all
eq.reestimate
The following reestimates an equation with the provided <sample spec>.
Code: Select all
eq.reestimate(smpl=<sample spec>)
Re: Reestimate equation with different sample without specifying it again
That's awesome, thanks a lot! Currently I use @varlist to get the variables from the equation to estimate it again. Your solution is obviously far better!
Re: Reestimate equation with different sample without specifying it again
I just tried it. Unfortunately it doesn't work. I estimated the equation for all years up to 1994. Then I tried to reestimate it for all years before 2000:
The result still says:
What did I do wrong?
Code: Select all
equation_name.reestimate(@year < 2000)
The result still says:
Code: Select all
Sample: 1970 2013 IF @YEAR<=1994
What did I do wrong?

 EViews Developer
 Posts: 262
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Reestimate equation with different sample without specifying it again
It does, thanks a lot!
Re: Reestimate equation with different sample without specifying it again
I have an additional question. If I set the sample in the "Estimation settings" (and not in the workfile), then the sample given to the reestimate procedure seems to be only a "subsample" of the one in the "Estimation settings". In other words, if there isn't the whole sample in the settings the reestimate procedure will not work "properly". Is there a command to change the sample in the settings? I just want to make sure that the whole sample is selected before doing the reestimate.
E.g. in the "Estimation settings" the sample "1970 2002" is used. The command
will then only use the sample up to 2002. I assume that the reestimate procedure will also update the sample used in the makeresid procedure?
E.g. in the "Estimation settings" the sample "1970 2002" is used. The command
Code: Select all
equation_name.reestimate(smpl = if @year <= 2010)
will then only use the sample up to 2002. I assume that the reestimate procedure will also update the sample used in the makeresid procedure?

 EViews Developer
 Posts: 262
 Joined: Thu Apr 25, 2013 7:48 pm
Re: Reestimate equation with different sample without specifying it again
You should be able to include @all in the reestimate sample, just as if you were using the smpl command:
Code: Select all
equation_name.reestimate(smpl = @all if @year <= 2010)
Who is online
Users browsing this forum: No registered users and 8 guests