Help with fitted values

For technical questions regarding estimation of single equations, systems, VARs, Factor analysis and State Space Models in EViews. General econometric questions and advice should go in the Econometric Discussions forum.

Moderators: EViews Gareth, EViews Moderator

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Help with fitted values

Postby cap » Tue Dec 23, 2008 7:37 am

Hello,

I hope this isn't too elementary of a question, but I am having some problems getting fitted values out of an equation.


I estimate an equation using sample period A to period C,

I then set my workfile sample from period A to period B,

Then I get the fitted values from my equation.

My problem is that the fitted values between periods B and C are now forced to being the actual values ... is this done on purpose for some reason?

Going back to my equation output and viewing the actual/fitted/residual table does show the truly fitted values for all periods between A and C, so I don't see why replacing some fitted values with actual values because of the workfile sample would be done on purpose...



A related question: if I do this command, myeq.fit(f="na") myfitted, doesn't this mean that all observations outside the sample used for the equation estimation are supposed to be "NA" ? I still get actual values placed into the series myfitted.



Thanks in advance,
-cap

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Help with fitted values

Postby EViews Gareth » Tue Dec 23, 2008 9:56 am

Could you provide more detail on what "Then I get the fitted values from my equation." means? How are you getting the fitted values?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Help with fitted values

Postby EViews Gareth » Tue Dec 23, 2008 10:01 am


A related question: if I do this command, myeq.fit(f="na") myfitted, doesn't this mean that all observations outside the sample used for the equation estimation are supposed to be "NA" ? I still get actual values placed into the series myfitted.
-cap

Remove the quotes. The command should be myeq.fit(f=na)

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Re: Help with fitted values

Postby cap » Tue Dec 23, 2008 12:02 pm

Ah, ok thanks, the (f=na) option does work now. An error message would be nice for a syntax error like that, I guess I will post that in the wish list board.


My command for fitted values is just this: myeq.fit myfitted.

It seems that the fitted value series that is created depends on the workfile sample. And, in the scenario I mentioned earlier, actual values will be inserted for certain observations even though fitted values from the estimation also exist for those same observations. Is this done on purpose for some reason? Seems like it would lead to erroneous fitted values in my opinion.



Thanks very much.
-cap

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Help with fitted values

Postby EViews Gareth » Tue Dec 23, 2008 12:06 pm

Yes, by design both the fit and the forecast commands (and indeed 99% of commands in EViews) apply to the current workfile sample.

The fit command is really used to produce a static forecast. It just so happens that if you do a static forecast over the original estimation sample, you can generate fitted values. However there are more general uses for static forecasts other than generating fitted values, and thus allowing the user to specify the sample over which the forecast takes place is desirable.

cap
Posts: 55
Joined: Fri Oct 17, 2008 11:47 am

Re: Help with fitted values

Postby cap » Tue Dec 23, 2008 12:16 pm

Ok, I guess that makes more sense ... so, would you say there is any other more preferred way to store fitted values into a series?

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Help with fitted values

Postby EViews Gareth » Tue Dec 23, 2008 12:22 pm

No, the .fit command is probably the best way to do it - just make sure to set the sample before doing it.

divac
Posts: 10
Joined: Sun Jan 30, 2011 4:36 pm

Re: Help with fitted values

Postby divac » Mon Apr 04, 2011 9:47 am

is there any way to program repetition of storing fitted values from a number of equations (say 100)? so after I ran 100 equations (eq{!i}) I would have 100 myfitted{!i} variables.

Thanks

EViews Gareth
Fe ddaethom, fe welon, fe amcangyfrifon
Posts: 13584
Joined: Tue Sep 16, 2008 5:38 pm

Re: Help with fitted values

Postby EViews Gareth » Mon Apr 04, 2011 11:19 am

Use the fit command in a program to generate the fitted variables.


Return to “Estimation”

Who is online

Users browsing this forum: No registered users and 2 guests