## 10.7 The projection matrix

Denote by \(\bm{\hat{y}}_h\) a set of \(h\)-step-ahead base forecasts generated for each series in a hierarchical or grouped structure and stacked the same way as the data. For example for the hierarchy of Figure 10.1 \[ \bm{\hat{y}}_h=\begin{bmatrix} \hat{y}_h \\ \yhat{A}{h} \\ \yhat{B}{h} \\ \yhat{AA}{h} \\ \yhat{AB}{h} \\ \yhat{AC}{h} \\ \yhat{BA}{h} \\ \yhat{BB}{h} \\ \end{bmatrix}. \]

In general, all forecasting approaches for either hierarchical or grouped structures can be represented as \[\begin{equation} \bm{\tilde{y}}_h=\bm{S}\bm{P}\bm{\hat{y}}_h \tag{10.6} \end{equation}\]where reading from right to left, \(\bm{\hat{y}}_h\) is the set of \(h\)-step-ahead base forecasts as defined above, \(\bm{P}\) is a matrix that projects the base forecasts into the bottom-level, and the summing matrix \(\bm{S}\) sums these up using the aggregation structure to produce a set of coherent forecasts \(\bm{\tilde{y}}_h\).

The \(\bm{P}\) matrix is defined according to the approach implemented. For example if the bottom-up approach is used to forecast the hierarchy of Figure 10.1, \[\bm{P}= \begin{bmatrix} 0 & 0 & 0 & 1 & 0 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 1 & 0 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 1 & 0 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 1 & 0\\ 0 & 0 & 0 & 0 & 0 & 0 & 0 & 1\\ \end{bmatrix}. \] Notice that the \(\bm{P}\) comprises two partitions. The first three columns which zero out the base forecasts of the series above the bottom-level and the \(m\)-dimensional identity matrix which picks only the base forecasts of the bottom-level, to then be summed up the hierarchy by the \(\bm{S}\) matrix.

If any of the top-down approaches were used then \[ \bm{P}= \begin{bmatrix} p_1 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ p_2 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ p_3 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ p_4 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ p_5 & 0 & 0 & 0 & 0 & 0 & 0 & 0\\ \end{bmatrix}. \] The first column includes a set of proportions that distribute the base forecasts of the top-level to the bottom-level. These are then summed up the hierarchy by the \(\bm{S}\) matrix. The rest of the columns zero out the base forecasts below the very top-level of aggregation.

For a middle out approach the \(\bm{P}\) matrix will be a combination of the above two. Using a set of proportions, the base forecasts of some pre-chosen level will be disaggregated to the bottom-level to then be summed up the hierarchy with the summing matrix, with all other base forecasts being zeroed out.