Superimposing 2 fan charts

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
ac_1
Posts: 468
Joined: Thu Apr 15, 2010 6:30 am

Superimposing 2 fan charts

Unread post by ac_1 »

Hi Tom,

Forecasting Methods , 3e , by Makridakis, Wheelwright, and Hyndman (1998, Wiley) p.366, https://estima.com/textbooks/makridakis ... h3p366.rpf, has a fan chart for the model boxjenk(diffs=1,sdiffs=1,ma=1,sma=1,maxl,define=weq) writing, but let's say I specify another ARIMA model & forecast for the same time periods, how would I superimpose 2 fan charts on a single graph.

thanks,
Amarjit
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: Superimposing 2 fan charts

Unread post by TomDoan »

You can do STYLE=FAN and OVERLAY=FAN, but it almost certainly won't work since whichever one is done second will paint over the one done first.
ac_1
Posts: 468
Joined: Thu Apr 15, 2010 6:30 am

Re: Superimposing 2 fan charts

Unread post by ac_1 »

I have specified a different model with much wider fans:

Code: Select all

boxjenk(diffs=1,sdiffs=1,ar=4,ma=4,sma=1,maxl,define=weq_M2) writing
and plotted 3 graphs. The green graph should appear on-top-of the orange graph (the orange fans should be visible, as are both the point forecasts); the 3rd graph being:

Code: Select all

graph(footer="Forecasts and Prediction Intervals",$
  ovcount=8,overlay=fan,ovsame) 11
# writing 1969:1 1972:12
# wfore_M2 1973:1 1974:12 2
# wfore_M1 1973:1 1974:12 4
# lower95_M2 1973:1 1974:12 3
# lower80_M2 1973:1 1974:12 3
# upper80_M2 1973:1 1974:12 3
# upper95_M2 1973:1 1974:12 3
# lower95_M1 1973:1 1974:12 9
# lower80_M1 1973:1 1974:12 9
# upper80_M1 1973:1 1974:12 9
# upper95_M1 1973:1 1974:12 9
Attachments
ac_mwhp366.jpg
ac_mwhp366.jpg (299.3 KiB) Viewed 26932 times
TomDoan
Posts: 7779
Joined: Wed Nov 01, 2006 4:36 pm

Re: Superimposing 2 fan charts

Unread post by TomDoan »

That's not how the fan style works. It does various shades of color of the first covered series (evenly scaling down the R, G and B components of the color). You can do two separate fans by using STYLE=FAN and OVERLAY=FAN. However, note that FAN (and BAR and a few others) are "painted" styles---they completely cover all the pixels in a region. Because it makes little sense to do lines and then a paint style, RATS will render the paint style first, then do the lines over that. However, if you do two painted styles, the first is covered by the second---all that would be visible would be any piece that is completely outside the region covered by the second, which won't be anything resembling a "fan".
Post Reply