BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
AllSoEasy
Obsidian | Level 7

I am currently having issues with forecasting out future forecasts with differencing in the model with proc varmax. Varmax is identifying the changes in the independent variables (+100 shock) properly when there is no differening in the variables, however in the differenced environment, the first forecasted value is exacty the value of the estimated beta coefficient in the model, and then the rest of the forecasted values are 0.

Is therea way to correctly calcualte & plot future forecasts in a differenced environment with proc varmax?

(example code of what I am attempting to do):

proc varmax data=forecast_dataset plots=ALL;

     model retvar = ratevar_shock100 / noint dif=(retvar(1) ratevar_shock100(1));

     output lead=24 back=12 out=forecasts;

run;

All values in data set are populated up until last 12 rows 'retvar' has missing values which are to be forecasted.

Thank you for your time and any suggestions.

-Ryan

1 ACCEPTED SOLUTION

Accepted Solutions
udo_sas
SAS Employee

Hello Ryan -

Please excuse for delay - our developers have been able to replicate the problem which you are reporting.

At this point in time I would suggest to open a track with Technical Support, who are already aware of this communication.

Thanks!

Udo

View solution in original post

5 REPLIES 5
udo_sas
SAS Employee

Hello Ryan -

Many thanks for your question about using VARMAX with differencing in the model.

Our R&D team is currently investigating the question at hand - it would really help with you could provide us with a complete example - including data (even "faked" data will work.

Another thought which crossed my mind was if a more simplistic approach might help addressing your problem at hand as well. If I understand correctly you would like to forecast "retvar" using "ratevar_shock100" as a input variable (assuming that there is cross-correlation between the two). In this case a UCM or ARIMAX approach might be applicable as well.

Thanks!

Udo

AllSoEasy
Obsidian | Level 7

Essentially we have 96 rows of observed data, including 96 observations of "retvar" and 96 observations of "ratevar." It is known that retvar is directly correlated with ratevar. What we are trying to do is add 12 "observations" to ratevar that are all equal to ratevar + 1, to do this we just add a column to the dataset "ratevar_shock100" which contains the observed values of ratevar up until the 96th observation, and then the values are equal to the 96th (last) ratevar observation + 1, while retvar contains missing values, these missing values in retvar are what we want to forecast (i.e. see how the value of retvar will adapt as the +1 shock is induced in ratevar). The last 12 observations + 12 to-be-forecasted observations are as such:

retvarratevar_shock100
0.2985280.2836085
0.2871830.2828952
0.2889750.2500238
0.2137380.2418523
0.2411520.2398289
0.2170880.2389318
0.2231590.2431974
0.2435460.2464614
0.2347810.2378387
0.2352360.2213375
0.2226610.2134652
0.1835330.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.1.2088864
.

1.2088864

We have many models to forecast this data, some using further variables, but our simplest model is:

proc varmax data=forecast_dataset plots=ALL;

     model retvar = ratevar_shock100 / noint dif=(retvar(1) ratevar_shock100(1));

     output lead=24 back=12 out=forecasts;

run;

And even this model is zeroing out as described in the original post.

For now we are just running varmax on the observed data set to obtain values for the beta coefficients in the model, and then just manually calculating the forecasts. However, we would like to be able to have varmax compute the forecasts accurately as it would be much more efficient and require much code/manual calculation.

Here is an example of the forecasts we are obtaining from proc varmax with the above model statement:

retvar_actualretvar_forecastsratevar_shock100
0.2985275380.3448688590.2836085
0.2871832520.2984598170.2828952
0.2889752250.2840624310.2500238
0.2137375440.288199420.2418523
0.2411520460.2135454410.2398289
0.2170878280.2410668750.2389318
0.2231589870.2174928050.2431974
0.2435457450.2234688730.2464614
0.2347808940.2427271040.2378387
0.2352356850.2332142650.2213375
0.2226609010.2344882870.2134652
0.1835330310.2222261880.2088864
.0.0949402941.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864
.01.2088864

And here is an example of correct forecast data obtained from manual calculation with beta value obtained from varmax on observed dataset:

retvar_actualretvar_forecastsratevar_shock100
0.2985275380.2984598170.2836085
0.2871832520.2840624310.2828952
0.2889752250.288199420.2500238
0.2137375440.2135454410.2418523
0.2411520460.2410668750.2398289
0.2170878280.2174928050.2389318
0.2231589870.2234688730.2431974
0.2435457450.2427271040.2464614
0.2347808940.2332142650.2378387
0.2352356850.2344882870.2213375
0.2226609010.2222261880.2134652
0.1835330310.1835330310.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864
.0.2784733251.2088864

Please let me know if this makes sense, and/or if you would like any more information.

Thanks a lot for your time,

-Ryan

AllSoEasy
Obsidian | Level 7

Also, something I forgot to add that may be of value: the beta value for the model obtained from running varmax on the observed data set is: XL0_1: 0.094940294

Which is what we use to manually calculate the forecasts outside of varmax, and also is interestingly exactly the first forecast value given from varmax's forecasts before they 0 out.

udo_sas
SAS Employee

Hello Ryan -

Please excuse for delay - our developers have been able to replicate the problem which you are reporting.

At this point in time I would suggest to open a track with Technical Support, who are already aware of this communication.

Thanks!

Udo

AllSoEasy
Obsidian | Level 7

- So do I get a SAS t-shirt or something for discovering this bug? 😛

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2074 views
  • 1 like
  • 2 in conversation