Dear All,
Possibly not a bug (please feel free to move the thread to the appropriate sub-forum), but I am confused as to what is happening. I've written a routine which has computed a very large number of forecasts, but one error occurs with one of the combinations of the variables: 'attempt to raise a negative number to a non-integer power'. Please see the attached workfile. What (non-linear) calculations could EViews be doing from a .forecast on a single OLS equation which would involve raising a negative number to a non-integer power? What combination of events means that this error is occurring for this combination of variables, but not any of the other billions which I've estimated? I am slightly perplexed, and any help would be gratefully received!
Very best wishes, as always!
Charlie
Edit: Some further thought on the matter has lead me to think that it could be something to do with the way that EViews is recovering the forecasts to levels from the @pca transformation, but I'm still unsure as to what's going on.
Strange Behaviour of .forecast
Moderators: EViews Gareth, EViews Moderator
-
CharlieEVIEWS
- Posts: 202
- Joined: Tue Jul 17, 2012 9:47 am
Strange Behaviour of .forecast
- Attachments
-
- EViews nonnegative noninteger power.WF1
- (13.67 KiB) Downloaded 328 times
Last edited by CharlieEVIEWS on Mon Jan 26, 2015 9:30 am, edited 1 time in total.
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Strange Behaviour of .forecast
Not really a bug, but a quirk of the way that EViews does forecasts...
For various complicated reasons, even though you are forecasting @pca(X), EViews first forecasts X and then calculates @pca(X). It forecasts X by calculating what @pca(X) is and then finding the inverse of the @pca function.
So, in your case, for 2007Q3, if you calculate:
You receive an answer of -101.8556.
EViews takes that number as @pca(X) and then tries to calculate X.
From that you can see that if @pca(X) is less than -100, you will receive an error since @pca(X)+100 will be negative, and then you're raising it to a fractional power (1/4).
This is a case where, if you really want to forecast @pca(x), you're better off creating a variable equal to @pca(x) and using that as the dependent variable, rather than the expression. EViews will be able to forecast that no problem.
For various complicated reasons, even though you are forecasting @pca(X), EViews first forecasts X and then calculates @pca(X). It forecasts X by calculating what @pca(X) is and then finding the inverse of the @pca function.
So, in your case, for 2007Q3, if you calculate:
Code: Select all
C(1) + C(2)*@PCA(AZ(-8)) + C(3)*SER47(-8) + C(4)*@PCA(AZ(-9)) + C(5)*SER47(-9) + C(6)*@PCA(AZ(-10)) + C(7)*SER47(-10)
EViews takes that number as @pca(X) and then tries to calculate X.
Code: Select all
@pca(X) = 100((1+ @pch(x))^4 - 1)
((@pca(x)+100)/100)^(1/4) = 1+@pch(x)
This is a case where, if you really want to forecast @pca(x), you're better off creating a variable equal to @pca(x) and using that as the dependent variable, rather than the expression. EViews will be able to forecast that no problem.
-
CharlieEVIEWS
- Posts: 202
- Joined: Tue Jul 17, 2012 9:47 am
Re: Strange Behaviour of .forecast
Thank you so much Gareth - as always, a perfectly clear explanation of what was going on. I shall remedy the situation as you suggest (and indeed - I think you once told me that for a large number of calculations, program efficiency will be increased by transforming prior to estimating, rather than using @functions in procedures: I should have listened better!)
Thanks again,
Charlie
Thanks again,
Charlie
Who is online
Users browsing this forum: No registered users and 2 guests
