[1] Compute the contribution for variable $j$ to the risk measures for $t+h$
at time $t$.

begin

[a] Iterate over random samples. The sampling population is the set of all
time-period/variable permutation pairs.

for  _$m=1:M$_ do

[i]Sample a random time period, $t^{*}\in_{R}[1:t-1]$, from the the preceding
sample of observations and set $\bm{z}_{t}=\bm{x}_{t^{*}}$.

[ii] Choose a random permutation of variables, $S$, i.e. sample
$S\subseteq_{R}[1,\dots,j-1,j+1,\dots,n]$, where $|S|\leq n-1$.

[iii] Create two new data vectors. For the first vector, replace the values in
$\bm{x}_{t}$ with the values in $\bm{z}_{t}$ for the indices in $S$. For the
second vector, also replace $x_{t,j}$ with $z_{t,j}$. As an example, let
$S=[1,j+1,\dots,\j+n]$. This yields:  $\displaystyle\bm{x}_{t}^{+j}$
$\displaystyle=[z_{t,1},x_{t,2},\dots,x_{t,j-1},x_{t,j},z_{t,j+1},\dots,z_{t,n}]$
$\displaystyle\bm{x}_{t}^{-j}$
$\displaystyle=[z_{t,1},x_{t,2},\dots,x_{t,j-1},z_{t,j},z_{t,j+1},\dots,z_{t,n}].$
[iv] Compute the contribution for $j$ to $DR_{\alpha}$ and $EIR_{\beta}$ at
draw $m$.

$\displaystyle V_{m,j}^{DR_{\alpha}}$
$\displaystyle=-\left(\int_{-\infty}^{\underline{\pi}}(\underline{\pi}-\pi)^{\alpha}f_{x}(\pi)_{t+h|t}^{+j}d\pi-\int_{-\infty}^{\underline{\pi}}(\pi-\bar{\pi})^{\alpha}f_{x}(\pi)_{t+h|t}^{-j}d\pi\right)$
$\displaystyle V_{m,j}^{EIR_{\beta}}$
$\displaystyle=\int_{\bar{\pi}}^{\infty}(\underline{\pi}-\pi)^{\beta}f_{x}(\pi)_{t+h|t}^{+j}d\pi-\int_{\bar{\pi}}^{\infty}(\pi-\bar{\pi})^{\beta}f_{x}(\pi)_{t+h|t}^{-j}d\pi$

end for

[b] Compute the contribution of $j$ to $DR_{\alpha}$ and $EIR_{\beta}$,
$\hat{\varphi}_{j}^{DR_{\alpha}}$ and $\hat{\varphi}_{j}^{EIR_{\beta}}$, by
taking the average over all samples, $M$.
$\hat{\varphi}_{j}^{DR_{\alpha}}=\frac{1}{M}\sum_{m}^{M}V_{m,j}^{DR_{\alpha}}\text{
and
}\hat{\varphi}_{j}^{EIR_{\beta}}=\frac{1}{M}\sum_{m}^{M}V_{m,j}^{EIR_{\beta}}.$

end

Notes: $\subseteq_{R}$ and $\in_{R}$ denote a random subset and random
element, respectively. The integrals can be computed with quadrature methods.

Algorithm 4 Risk Measure Decompositions

##  Appendix C Additional Algorithms

###  C.1 Computing Quantiles

By the properties of the normal distribution, the sum of multiple normals is
again normal. The CDF and PDF are hence available as the sum of the
appropriately reweighted individual mixture components, as shown above.
However, this convenient property does not hold for the quantile function. An
analytical solution is hence not available, however, quantiles can be computed
using simple root finding procedure, where

$\Phi_{x}({\pi}_{t+h})\big{\rvert}_{\hat{Q}_{x}^{\tau}({\pi}_{t+h})}-\tau=0,$
(24)

where $\tau$ denotes a percentile of interest and $\Phi_{x}({\pi}_{t+h})$
denotes the CDF of the mixture model that is evaluated at a candidate solution
$\hat{Q}_{x}^{\tau}({\pi}_{t+h})$. The desired percentile,
$Q_{x}^{\tau}({\pi}_{t+h})$, is the solution to Equation (24). Note that
because the CDF is proper and we estimate the entire distribution
simultaneously, the resulting conditional quantiles do not cross. This is an
advantage compared to univariate quantile regressions models.

###  C.2 Computing the Optimal Number of Mixture Components

As mentioned above, the performance of the mixture model also hinges on the
truncation point of the infinite sum of mixture components. Especially in
forecasting exercises, it might hence be useful to select this truncation
point automatically. In the Bayesian context, the marginal data likelihood
allows to solve this model selection problem; however the computation of the
marginal likelihood is usually computationally cumbersome. In the context of
Variational Bayes, the ELBO, i.e. the convergence criterion of the
optimization problem, provides an accurate approximation of the marginal
likelihood. Because the algorithm is computationally fast, solving the model
selection problem with VB is hence an ideal alternative. This gives rise to
the following algorithm:

  1. 1.

Set an upper bar on the number of mixture components $\bar{C}$.

  2. 2.

For $C=1,\dots,\bar{C}$, re-estimate the model with VB an store the ELBO.

  3. 3.

Set

$C^{*}=\operatorname*{arg\,max}_{C}ELBO_{C}.$

  4. 4.

Re-estimate/store the estimates for the model estimated with $C^{*}$.

Because the algorithm is fast, this optimization can even be repeated in real-
time at every new data vintage, provided $\bar{C}$ is not too large. For
macroeconomic data, $\bar{C}=5$ or $\bar{C}=10$ are useful starting points.

##  Appendix D Proof

###  D.1 Proof of Lemma 2.4

###### Proof.

Let $f_{x}(\pi)_{t+h|t}$ denote the forecast distribution of inflation at time
$t$ for horizon $t+h$. Further, let $\pi^{\star}$ denote a set of $g$ ordered
grid points across the entire support of $\pi$. ${\pi}^{\star}_{i}$ and
${\pi}^{\star}_{i-1}$ hence denote two neighbouring grid points such that
${\pi}^{\star}_{i-1}<{\pi}^{\star}_{i}$. Further, let
$\pi_{1}^{\star}=-\infty$ and $\pi_{g}^{\star}=\infty$. Then

$\displaystyle\int_{-\infty}^{\infty}f_{x}(\pi)_{t+h|t}dx=\sum_{i=2}^{g}\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h|t}dx=1$

Analogously,

$\displaystyle\int_{-\infty}^{\infty}f_{x}(\pi)_{t+h}dx=\sum_{i=2}^{g}\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h}dx=1.$

Given the definition of the predictor contributions

$\sum_{j}^{n}\varphi_{j}^{\pi_{i}^{\star}}+\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h}d\pi=\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h|t}dx.$

As a result

$\int_{-\infty}^{\infty}f_{x}(\pi)_{t+h|t}dx=\sum_{i=2}^{g}\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h|t}dx=\sum_{i=2}^{g}\left[\sum_{j}^{n}\varphi_{j}^{\pi_{i}^{\star}}+\int_{{\pi}^{\star}_{i-1}}^{{\pi}^{\star}_{i}}f_{x}(\pi)_{t+h}d\pi\right]=1.$

∎