# Yearly restrictions on quarterly forecast in ARMA

I was thinking, is it possible to implement a quarterly forecast for one year ahead such that its sum over year equals some constant number?

This problem may arise if we have, for example, some external forecast over next year, and we need to produce a quarterly forecast that is consistent with the yearly one.

Theoretically, I can write down an ML-maximization problem, and write then some stack of code. But is there maybe some existing solutions?

The simplest approach would of course be to calculate unconstrained quarterly forecasts $\hat{y}_1, ..., \hat{y}_4$ and then scale them so the sum is equal to your preset yearly total $\hat{y}$: $$\tilde{y}_t := \frac{\hat{y}_t}{\sum_j\hat{y}_j}\times\hat{y}$$

Yes, this is ad-hoc, and of course you could do some kind of constrained likelihood maximization. However, I'd guess that imprecisions in both your yearly and your quarterly forecasts will trump any ad-hoccery in calculations.

Alternatively, I'd recommend that you look into forecasting your series on multiple time granularities, e.g., yearly, half-yearly, quarterly and monthly, and then combine the forecasts. This can pick up structure that is visible on different frequencies.

The MAPA algorithm by Kourentzes & Petropoulos does this. You can use the eponymous R package.

• Can you use that approach for multiple seasonalities? – RandomDude Oct 30 '15 at 11:00
• @RandomDude: the simple rescaling approach doesn't care where the original forecasts come from, so those could certainly come from models incorporating multiple seasonalities. (The "total" forecast needs to be a single number, though - although it could also be multiple numbers that in themselves are sum consistent.) MAPA can conceptually certainly model multiple seasonalities, and of course it already does cover monthly, quarterly, half-yearly and such seasonalities. It would also work if you had, say, seasonalities arising from the Western and the Muslim calendar. I don't know whether... – Stephan Kolassa Oct 30 '15 at 11:13
• ... the MAPA package as such already covers multiple seasonalities. – Stephan Kolassa Oct 30 '15 at 11:14
• seems like the mapa package itself is limited to time-series frequencies <= 24 based on the same restriction for the ets() model. guess there is no easy work around for that? – RandomDude Oct 30 '15 at 11:42
• @RandomDude: not easy, no. But you can build your own MAPA algorithm. Essentially, you calculate forecasts on all time granularities, using whatever method you like. Then you apply Hyndman's optimal combination approach to combine all original forecasts, for which you just need the appropriate summation matrix. – Stephan Kolassa Oct 30 '15 at 12:52