Box Cox Autoarma Error
Moderators: EViews Gareth, EViews Jason, EViews Moderator
Box Cox Autoarma Error
I've been using:
freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=auto,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
without issue.
However, when choosing the transform as BoxCox (tform=bc, bc=2) I get errors stating "Attempt to raise a negative number to a non integer power". What is going on here? I have written a program that will find "optimal" lambdas and would like to use it, but even with the standard options I get this error.
Any ideas? Thanks
freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=auto,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
without issue.
However, when choosing the transform as BoxCox (tform=bc, bc=2) I get errors stating "Attempt to raise a negative number to a non integer power". What is going on here? I have written a program that will find "optimal" lambdas and would like to use it, but even with the standard options I get this error.
Any ideas? Thanks

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Box Cox Autoarma Error
Is your copy of EViews up to date?
Seems to work for me:
Seems to work for me:
Code: Select all
wfcreate m 1990 2020
series y=rnd
%series = "y"
!fcst_length=12
smpl 1990 2019
freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=bc, bc=2,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
Follow us on Twitter @IHSEViews
Re: Box Cox Autoarma Error
We are using the Enterprise Edition of 10+ Nov 30 2017 Build. Check for update says we are good. Rebooted machine and still the error. Error does not occur when using the GUI. The error only occurs when the tform option changes from tform=auto to tform=bc, bc=2. I plan to pass the lambda to bc with the optimal one found.
Note that if I use bc=1, 0.5, 0, 0.5, 1 are ok.
if lambda is 2 or 2 or higher/lower, EViews fails. With the positive 2 I get the error "Attempt to raise a negative number to a non integer power"
if I se lambda of 2 I get error "^ function given an out of range argument"
Lambdas of 2 and 2 are common, so I am not sure why EViews is bombing at the command line and not the GUI.
The manual says bc=int Set the power of the BoxCox transformation. Only applicable if the tform=bc option is used.
Again, the GUI handles everything fine.
Note that if I use bc=1, 0.5, 0, 0.5, 1 are ok.
if lambda is 2 or 2 or higher/lower, EViews fails. With the positive 2 I get the error "Attempt to raise a negative number to a non integer power"
if I se lambda of 2 I get error "^ function given an out of range argument"
Lambdas of 2 and 2 are common, so I am not sure why EViews is bombing at the command line and not the GUI.
The manual says bc=int Set the power of the BoxCox transformation. Only applicable if the tform=bc option is used.
Again, the GUI handles everything fine.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Box Cox Autoarma Error
Did you try the code:
Code: Select all
wfcreate m 1990 2020
series y=rnd
%series = "y"
!fcst_length=12
smpl 1990 2019
freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=bc, bc=2,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
Follow us on Twitter @IHSEViews
Re: Box Cox Autoarma Error
Well I am totally messed up here...your code worked. I don't see where I am going wrong.
Here is my code. I still get the errors
Don't know why this does not work.
Here is my code. I still get the errors
Code: Select all
close @all
%m=@left(@date,2)
%d=@mid(@date,4,2)
!year=2000+@right(@date,2
!annual1=2000
!annual2=2020
%history_end_date="2017.11"
%forecast_start_date="2017.12"
%forecast_end_date="2020.1"
!fcst_length=@datediff(@dateval(%forecast_end_date, "yyyy.mm"),@dateval(%forecast_start_date, "yyyy.mm"),"mm")+1
wfcreate arima_{!year}.{%m}.{%d} u !annual1 !annual2
%wfsaveloc="R:\Eviews\Workfiles\ARIMA\Fees"
pagecreate m !annual1 !annual2
pagerename untitled1 navdat_m
smpl @all
FETCH(d=R:\Eviews\Databases\Main\nav_data_all_ts.edb) ovr_ecu_m11_n ovr_ecu_m14_n ovr_ecu_m22_n ovr_ecu_m23_n
%vars="ovr_ecu_m11_n ovr_ecu_m14_n ovr_ecu_m22_n ovr_ecu_m23_n"
for %series {%vars}
smpl @first %history_end_date
freeze(mode=overwrite,{%series}_stats) {%series}.autoarma(tform=bc,bc=2,diff=2,select=aic,periods=12,kpsssig=5,eqname={%series}_eq,maxar=4,maxma=3,maxsar=1,maxsma=1,seed=131071,forclen={!fcst_length},etable,agraph,atable,fgraph) forecast
{%series}_eq.fit(e) {%series}_fit
next
Don't know why this does not work.
Re: Box Cox Autoarma Error
In the EViews database I am using, there are a total of 5 variables that exhibit this behaviour. That is, they cause crashes of EViews form within the program code, but work perfectly within the GUI. I can calculate BoxCox transforms on my own and they work fine. This is a weird problem, which may be with EViews. Any other insight is great.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Box Cox Autoarma Error
Would it be possible for you to provide the data?
Follow us on Twitter @IHSEViews
Re: Box Cox Autoarma Error
Yes I can. Workfile is attached (hopefully)
 Attachments

 GarethTest.WF1
 (24.69 KiB) Downloaded 9 times

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Box Cox Autoarma Error
Can confirm I receive the same error. We'll investigate.
Follow us on Twitter @IHSEViews
Re: Box Cox Autoarma Error
Thanks...let me know when you can.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Re: Box Cox Autoarma Error
So what's going on is that for the (2,2,0,0) model, the forecast of the transform of the variable goes negative. Then EViews tries to undo the transformation (which involves taking the square root), and fails, giving the error message.
You could try creating a series that is equal to the BoxCox transformation of the variable yourself, doing the autoarma on it, selecting the correct model and then undoing the transformation manually. Yes this is a bit of a pain.
You could try creating a series that is equal to the BoxCox transformation of the variable yourself, doing the autoarma on it, selecting the correct model and then undoing the transformation manually. Yes this is a bit of a pain.
Follow us on Twitter @IHSEViews
Re: Box Cox Autoarma Error
Thanks. I am guessing that autoarma is differencing (this is auto) the BoxCoxed variable and forecasting a drop (negative value) and transforming that negative drop back ("un BoxCox"). This is problematic with a lambda of 2 (square root of negative number). I guess EViews tries to transform back before making a level forecast? If so, then perhaps it could be altered to take the forecasted change (which is what a difference is), add it to the previous BoxCox value, then transform the whole thing back.
So my options, if wanting to use a BoxCox transform are to:
1. Make the transform manually
2. Run autoarma to get the level forecasts (from differences if applicable)
3. Manually unBoxCox the forecast back.
This seem ok?
Thanks for your checking.
So my options, if wanting to use a BoxCox transform are to:
1. Make the transform manually
2. Run autoarma to get the level forecasts (from differences if applicable)
3. Manually unBoxCox the forecast back.
This seem ok?
Thanks for your checking.

 Fe ddaethom, fe welon, fe amcangyfrifon
 Posts: 11735
 Joined: Tue Sep 16, 2008 5:38 pm
Who is online
Users browsing this forum: No registered users and 1 guest