Page 1 of 1

Help with fitted values

Posted: Tue Dec 23, 2008 7:37 am
by cap
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

Re: Help with fitted values

Posted: Tue Dec 23, 2008 9:56 am
by EViews Gareth
Could you provide more detail on what "Then I get the fitted values from my equation." means? How are you getting the fitted values?

Re: Help with fitted values

Posted: Tue Dec 23, 2008 10:01 am
by EViews Gareth

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)

Re: Help with fitted values

Posted: Tue Dec 23, 2008 12:02 pm
by cap
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

Re: Help with fitted values

Posted: Tue Dec 23, 2008 12:06 pm
by EViews Gareth
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.

Re: Help with fitted values

Posted: Tue Dec 23, 2008 12:16 pm
by cap
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?

Re: Help with fitted values

Posted: Tue Dec 23, 2008 12:22 pm
by EViews Gareth
No, the .fit command is probably the best way to do it - just make sure to set the sample before doing it.

Re: Help with fitted values

Posted: Mon Apr 04, 2011 9:47 am
by divac
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

Re: Help with fitted values

Posted: Mon Apr 04, 2011 11:19 am
by EViews Gareth
Use the fit command in a program to generate the fitted variables.