A random vector X = (X1, …, Xd) follows a normal variance mixture, in notation X ∼ NVMd(μ, Σ, FW), if, in distribution, $$ \mathbf{X} = \mathbf{\mu}+\sqrt{W}A\mathbf{Z}, $$ where μ ∈ ℝd denotes the location (vector), Σ = AA⊤ for A ∈ ℝd × k denotes the scale (matrix) (a covariance matrix), and the mixture variable W ∼ FW is a non-negative random variable independent of Z ∼ Nk(0, Ik) (where Ik ∈ ℝk × k denotes the identity matrix). Both the Student’s t distribution with degrees of freedom parameter ν > 0 and the normal distribution are normal variance mixtures; in the former case, W ∼ IG (ν/2, ν/2) (inverse gamma) and in the latter case W is almost surely constant (taken as 1 so that Σ is the covariance matrix of X in this case).
It follows readily from the stochastic representation that linear combinations of multivariate normal variance mixtures are univariate normal variance mixtures. Let a ∈ ℝd. If X ∼ NVMd(μ, Σ, FW), then a⊤X ∼ NVM1(a⊤μ, a⊤Σa, FW).
If X models, for instance, financial losses, a⊤X is the loss of a portfolio with portfolio weights a. It is then a common task in risk management to estimate risk measures of the loss a⊤X. We consider the two prominent risk measures value-at-risk and expected shortfall.
In the following, assume without loss of generality that X ∼ NVM1(0, 1, FW), the general case follows from a location-scale argument.
The value-at-risk of X at confidence level α ∈ (0, 1) is merely the α-quantile of X. That is, VaRα(X) = inf {x ∈ [0, ∞) : FX(x) ≥ α},
where FX(x) = ℙ(X ≤ x)
for x ∈ ℝ is the distribution
function of X. Such quantile
can be estimated via the function qnvmix()
, or
equivalently, via the function VaR_nvmix()
of the
R
package nvmix
.
As an example, consider W ∼ IG (ν/2, ν/2)
so that X follows a t distribution with ν degrees of freedom. In this case,
the quantile is known. If the argument qmix
is provided as
a string, VaR_nvmix()
calls qt()
; if
qmix
is provided as a function or list, the quantile is
internally estimated via a Newton algorithm where the univariate
distribution function FX() is
estimated via randomized quasi-Monte Carlo methods.
set.seed(1) # for reproducibility
qmix <- function(u, df) 1/qgamma(1-u, shape = df/2, rate = df/2)
df <- 3.5
n <- 20
level <- seq(from = 0.9, to = 0.995, length.out = n)
VaR_true <- VaR_nvmix(level, qmix = "inverse.gamma", df = df)
VaR_est <- VaR_nvmix(level, qmix = qmix, df = df)
stopifnot(all.equal(VaR_true, qt(level, df = df)))
## Prepare plot
pal <- colorRampPalette(c("#000000", brewer.pal(8, name = "Dark2")[c(7, 3, 5)]))
cols <- pal(2) # colors
if(doPDF) pdf(file = (file <- "fig_VaR_nvmix_comparison.pdf"),
width = 7, height = 7)
plot(NA, xlim = range(level), ylim = range(VaR_true, VaR_est),
xlab = expression(alpha), ylab = expression(VaR[alpha]))
lines(level, VaR_true, col = cols[1], lty = 2, type = 'b')
lines(level, VaR_est, col = cols[2], lty = 3, lwd = 2)
legend('topleft', c("True VaR", "Estimated VaR"), col = cols, lty = c(2,3),
pch = c(1, NA))
if(doPDF) dev.off()
Another risk measure of great theoretical and practical importance is the expected-shortfall. The expected shortfall of X at confidence level α ∈ (0, 1) is, provided the integral converges, given by $$ \operatorname{ES}_\alpha(X) = \frac{1}{1-\alpha} \int_\alpha^1 \operatorname{VaR}_u(X)du.$$ If FX() is continuous, one can show that ESα(X) = E (X ∣ X > VaRα(X)).
The function ES_nvmix()
in the R
package
nvmix
can be used to estimate the expected shortfall for
univariate normal variance mixtures. Since these distributions are
continuous, we get the following:
$$ (1-\alpha) \operatorname{ES}_\alpha(X) = \operatorname{E}\left(X \mathbf{1}_{\{X>\operatorname{VaR}_\alpha(X)\}}\right)= \operatorname{E}\left( \sqrt{W} Z \mathbf{1}_{\{\sqrt{W} Z > \operatorname{VaR}_\alpha\}}\right) $$
$$= \operatorname{E}\Big( \sqrt{W} \operatorname{E}\big(Z \mathbf{1}_{\{Z> \operatorname{VaR}_\alpha(X)/\sqrt{W}\}} \mid W\big)\Big)= \operatorname{E}\left(\sqrt{W} \phi(\operatorname{VaR}_\alpha(X) / \sqrt{W})\right) $$
Here, ϕ(x) denotes
the density of a standard normal distribution and we used that ∫k∞xϕ(x)dx = ϕ(k)
for any k ∈ ℝ. Internally, the
function ES_nvmix()
estimates ESα(X) via a
randomized quasi-Monte Carlo method by exploiting the displayed
identity.
In case of the normal and t
distribution, a closed formula for the expected shortfall is known; this
formula is then used by ES_nvmix()
if qmix
is
provided as string.
ES_true <- ES_nvmix(level, qmix = "inverse.gamma", df = df)
ES_est <- ES_nvmix(level, qmix = qmix, df = df)
## Prepare plot
if(doPDF) pdf(file = (file <- "fig_ES_nvmix_comparison.pdf"),
width = 7, height = 7)
plot(NA, xlim = range(level), ylim = range(ES_true, ES_est),
xlab = expression(alpha), ylab = expression(ES[alpha]))
lines(level, ES_true, col = cols[1], lty = 2, type = 'b')
lines(level, ES_est, col = cols[2], lty = 3, lwd = 2)
legend('topleft', c("True ES", "Estimated ES"), col = cols, lty = c(2,3),
pch = c(1, NA))
if(doPDF) dev.off()