## fan chart levels forecasts from returns forecasts

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.

### fan chart levels forecasts from returns forecasts

Hi Tom,

I have calculated log returns from asset price levels and generated n-step ahead forecasts for the log returns. I have then calculated n-step ahead levels forecasts via:
levels_forecasts = exp(returns_forecasts) * price_level(fixed at end of estimation of regression date).

To create a fan chart for the returns_forecasts, the 95% prediction intervals are:
Code: Select all
`set lower95 beginf endf = returns_forecasts+%invnormal(.025)*stderrsset upper95 beginf endf = returns_forecasts+%invnormal(.975)*stderrs`

Do I just exp(stderrs) & have levels_forecasts instead to calculate 95% prediction intervals for the levels_forecasts?

Amarjit
ac_1

Posts: 296
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: fan chart levels forecasts from returns forecasts

Sorry; in what form are you computing the standard errors? If they are the standard errors in the n step forecasts for the log returns, then you need

exp(forecast+x stderr)*price to get an estimate of the x standard error percentile.
TomDoan

Posts: 7387
Joined: Wed Nov 01, 2006 5:36 pm

### Re: fan chart levels forecasts from returns forecasts

I'm puzzled. Attached is an example, g10xrate.xls with 3 graphs:
(1) LOG-RETURNS: forecasts and Prediction Intervals - the forecasts are correct, the prediction intervals are calculated using the formula from mwh3p366.rpf.
(2) LEVELS: forecasts - forecasts are correct and calculated from LOG-RETURNS.
(3) LEVELS: forecasts and Prediction Intervals - I am unclear as to the formula for the prediction intervals.

Code: Select all
`*===============================* read in dataOPEN DATA "/Users/Shared/RATS/Examples/g10xrate.xls"DATA(FORMAT=XLS,NOLABELS,ORG=COLUMNS,TOP=2) 1 6237 USXJPN USXFRA USXSUI USXNLD USXUK \$USXBEL USXGER USXSWE USXCAN USXITA** transform data into log formlog USXJPN / lUSXJPN** compute diff-log, approx. % percentage changeset dlUSXJPN = 100.0*( lUSXJPN - lUSXJPN{1} )***===============================linreg(define=fxeq) dlUSXJPN 6000 6237# constant dlUSXJPN{1 to 10}uforecast(equation=fxeq,stderrs=stderrs) dl_fxfore 6238 6248*** (1) graph LOG-RETURNS: forecasts and Prediction Intervals*set lower95 6238 6248 = dl_fxfore+%invnormal(.025)*stderrsset upper95 6238 6248 = dl_fxfore+%invnormal(.975)*stderrsprin 6200 6248 dlUSXJPN dl_fxfore stderrs lower95 upper95*graph(footer="LOG-RETURNS: forecasts and Prediction Intervals",ovcount=2,overlay=fan,ovsame) 4# dlUSXJPN 6200 6237# dl_fxfore 6238 6248# lower95 6238 6248# upper95 6238 6248*** (2) graph LEVELS: forecasts*set level_fxfore 6238 6248 = exp(dl_fxfore)*USXJPN(6237)prin 6200 6248 USXJPN dl_fxfore level_fxfore*graph(footer="LEVELS: forecasts") 2# USXJPN 6000 6237# level_fxfore 6238 6248*** (3) graph LEVELS: forecasts and Prediction Intervals*set level_lower95 6238 6259 = exp(level_fxfore+%invnormal(.025)*(stderrs))*USXJPN(6237)set level_upper95 6238 6259 = exp(level_fxfore+%invnormal(.975)*(stderrs))*USXJPN(6237)prin 6200 6248 USXJPN dl_fxfore level_fxfore level_lower95 level_upper95*graph(footer="LEVELS: forecasts and Prediction Intervals",ovcount=2,overlay=fan,ovsame) 4# USXJPN 6200 6237# level_fxfore 6238 6248# level_lower95 6238 6248# level_upper95 6238 6248`
ac_1

Posts: 296
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: fan chart levels forecasts from returns forecasts

The MWH example is doing a completely different forecast---the differences and seasonal differences are automatically incorporated into the forecasting formulas by BOXJENK.

On the other hand, you are estimating a model in log returns and your UFORECAST is forecasting log returns. A forecast of the log return from t+8 to t+9 combined with the price at t is not going to give you a forecast of the price at t+9 since log(price(t+9))-log(price(t)) is the sum of all the intermediate steps, not just the final period's return. If your goal is to forecast log price, you would be better off letting BOXJENK take care of the differencing itself, the way that is done in the MWH example (except you wouldn't need the seasonal differences)---the model you are using is an ARIMA(10,1,0) model on log price.
TomDoan

Posts: 7387
Joined: Wed Nov 01, 2006 5:36 pm

### Re: fan chart levels forecasts from returns forecasts

My goal is to forecast PRICE. The methodology I have used is to model LOG-RETURNS, generate forecasts for LOG-RETURNS with prediction intervals; then convert LOG-RETURNS forecasts to PRICE forecasts and calculate prediction intervals.

As per MWH example is the following code correct for LOG-PRICE with prediction intervals?

Code: Select all
`*===============================boxjenk(ar=10,diffs=1,define=fxeq) lUSXJPNuforecast(equation=fxeq,stderrs=stderrs) l_fxfore 6238 6248*** graph LOG-PRICE: forecasts and Prediction Intervals*set lower95 6238 6248 = l_fxfore+%invnormal(.025)*stderrsset upper95 6238 6248 = l_fxfore+%invnormal(.975)*stderrsprin 6200 6248 USXJPN l_fxfore stderrs lower95 upper95*graph(footer="LOG-PRICE: forecasts and Prediction Intervals",ovcount=2,overlay=fan,ovsame) 4# lUSXJPN 6200 6237# l_fxfore 6238 6248# lower95 6238 6248# upper95 6238 6248*`
Last edited by ac_1 on Tue Jan 12, 2021 4:20 pm, edited 1 time in total.
ac_1

Posts: 296
Joined: Thu Apr 15, 2010 6:30 am
Location: London, UK

### Re: fan chart levels forecasts from returns forecasts

That looks correct.
TomDoan

Posts: 7387
Joined: Wed Nov 01, 2006 5:36 pm