# Sampling the Multivariate Standard Normal Distribution under a Weighted Sum Constraint

## Abstract

**:**

## 1. Introduction

## 2. Derivation of the Conditional Density

**Lemma**

**1.**

- (i)
- $\mathbf{A}\left(m\right)$ is positive definite;
- (ii)
- its determinant is given by$$\left|\mathbf{A}\left(m\right)\right|=\sum _{k=0}^{m}\prod _{j=0,j\ne k}^{m}{a}_{j}=\pi \left(m\right)s\left(m\right);$$
- (iii)
- the $(i,j)$-element of the inverse $\mathbf{B}\left(m\right):={\left(\mathbf{A}\left(m\right)\right)}^{-1}$ is given by$${B}_{i,j}\left(m\right)=\frac{1}{{a}_{i}s\left(m\right)}\left({\delta}_{ij}\frac{{a}_{i}s\left(m\right)-1}{{a}_{i}}+\frac{{\delta}_{ij}-1}{{a}_{j}}\right).$$

## 3. Discussion

## 4. Sampling Algorithms

Algorithm 1. Sampling of $\mathbf{Z}$ given ${\mathbf{w}}^{\prime}\mathbf{Z}=c$. |

1. From the vector of weights $\mathbf{w}$ and the constraint c, compute the $(n-1)$-dimensional mean vector $\mathit{\mu}(c,\mathbf{w})$ and symmetric matrix $\mathsf{\Sigma}\left(\mathbf{w}\right)$ from (2) and (3); |

2. Compute the eigen decomposition of the covariance matrix $\mathsf{\Sigma}\left(\mathbf{w}\right)=\mathbf{V}\mathsf{\Lambda}{\mathbf{V}}^{\prime}$; |

3. Sample $(n-1)$ i.i.d. standard Normal variates $\tilde{\mathbf{z}}={({\tilde{z}}_{1},\dots ,{\tilde{z}}_{n-1})}^{\prime}$; |

4. Transform these variates using the mean vector and covariance matrix |

$\begin{array}{c}\tilde{\mathbf{x}}\leftarrow \mathit{\mu}(c,\mathbf{w})+\mathbf{V}\sqrt{\mathsf{\Lambda}}\tilde{\mathbf{z}};\end{array}$ |

5. Enlarge the $(n-1)$-dimensional vector $\tilde{\mathbf{x}}$ with the n-th component to get $\mathbf{x}$, |

$\begin{array}{c}\mathbf{x}\leftarrow {\left({\tilde{\mathbf{x}}}^{\prime},c-{\sum}_{i=1}^{n-1}{\tilde{x}}_{i}\right)}^{\prime};\end{array}$ |

6. Return $\mathbf{Z}$ where ${z}_{i}\leftarrow {x}_{i}/{w}_{i}$ for $i\in \{1,2,\dots ,n\}$. |

Algorithm 2. Sampling of $\mathbf{Z}$ given ${\mathbf{w}}^{\prime}\mathbf{Z}\le c$. |

1. Draw a sample u from a Uniform-$[0,1]$ distribution; |

2. Draw a sample $\tilde{c}$ from the conditional law of ${\mathbf{w}}^{\prime}\mathbf{Z}$ given ${\mathbf{w}}^{\prime}\mathbf{Z}\le c$: |

$\begin{array}{c}\tilde{c}\leftarrow \parallel \mathbf{w}\parallel {\mathsf{\Phi}}^{-1}\left(u\mathsf{\Phi}\left(\frac{c}{\parallel \mathbf{w}\parallel}\right)\right);\end{array}$ |

3. Apply Algorithm 1 using $\tilde{c}$ as constraint (i.e., $c\leftarrow \tilde{c}$); |

4. Return $\mathbf{Z}$. |

## 5. Applications

#### 5.1. Conditional Portfolio Distribution

#### 5.2. Expected Shortfall of a Defaultable Portfolio

## 6. Conclusions

## Funding

## Acknowledgments

## Conflicts of Interest

## Appendix A. General Expression of the Conditional Density

## Appendix B. Proof of Lemma 1.

## References

- Andersen, Leif B. G., and Jakob Sidenius. 2004. Extensions to the Gaussian copula: Random recovery and random factor loadings. Journal of Credit Risk 1: 29–70. [Google Scholar] [CrossRef]
- Cedilnik, Anton, Katarina Kosmelj, and Andrej Blejec. 2004. The distribution of the ratio of jointly Normal variables. Metodološki Zvezk 1: 99–108. [Google Scholar]
- Fieller, Edgar C. 1932. The distribution of the index in a normal bivariate population. Biometrika 23: 428–40. [Google Scholar] [CrossRef]
- Gentle, James E. 2007. Matrix Algebra: Theory, Computations, and Applications in Statistics. Berlin: Springer. [Google Scholar]
- Glasserman, Paul. 2010. Monte Carlo Methods in Financial Engineering. Berlin: Springer. [Google Scholar]
- Gordy, Michael B. 2003. A risk-factor model foundation for ratings-based bank capital rules. Journal of Financial Intermediation 12: 199–232. [Google Scholar] [CrossRef] [Green Version]
- Hull, John, and Alan White. 2004. Valuation of a CDO and an nth-to-default CDS without Monte Carlo simulation. Journal of Derivatives 12: 8–23. [Google Scholar] [CrossRef]
- Laurent, Jean-Paul, Michael Sestier, and Stéphane Thomas. 2016. Trading book and credit risk: how fundamental is the Basel review? Journal of Banking and Finance 73: 211–23. [Google Scholar] [CrossRef]
- Li, David X. 2016. On Default Correlation: A Copula Function Approach. Technical Report. Amsterdam: Elsevier. [Google Scholar]
- Meyer, Daniel W. 2018. (un)conditional sample generation based on distribution element trees. Journal of Computational and Graphical Statistics. [Google Scholar] [CrossRef]
- Pham, Dinh Tuan. 2000. Stochastic methods for sequential data assimilation in strongly nonlinear systems. Monthly Weather Review 129: 1194–207. [Google Scholar] [CrossRef]
- Pykhtin, Michael. 2004. Multifactor adjustment. Risk Magazine 17: 85–90. [Google Scholar]
- Rubinstein, Reuven Y., and Dirk Kroese. 2017. Simulation and the Monte Carlo Method. Hoboken: Wiley. [Google Scholar]
- Vasicek, Oldrich A. 1991. Limiting loan loss probability distribution. Finance, Economics and Mathematics. [Google Scholar] [CrossRef]
- Vrins, Frederic D. 2009. Double-t copula pricing of structured credit products—Practical aspects of a trustworthy implementation. Journal of Credit Risk 5: 91–109. [Google Scholar] [CrossRef]

**Figure 1.**Scatter plot of 250 samples $({x}_{1},{x}_{2})$ drawn for the four methods with $n=2$, ${w}_{1}^{2}=0.4$, ${w}_{2}^{2}=0.6$ and $c=1$. Method 4 yields the correct answer. The vertical and horizontal dashed lines show the empirical means of ${x}_{1}$ and ${x}_{2}$ for that specific run, respectively. The diagonal (red) solid line is ${x}_{2}=c-{x}_{1}$. The horizontal and vertical widths of the gray rectangles show the confidence intervals (${\widehat{\mu}}_{{x}_{i}}\pm 1.96\times {\widehat{\sigma}}_{{x}_{i}}$) for both ${X}_{1}$ and ${X}_{2}$ based on 100 runs of 250 pairs each.

**Figure 2.**Scatter plot of 250 samples $({x}_{1},{x}_{2})$ drawn for the four methods with $n=3$, ${w}_{1}^{2}={w}_{2}^{2}=0.4$, ${w}_{3}^{2}=0.2$ and $c=4$. Method 4 yields the correct answer. Only the first two components of the vector $({x}_{1},{x}_{2},{x}_{3})$ are shown to enhance readability; the third component is set to ${x}_{3}=c-({x}_{1}+{x}_{2})$. The vertical and horizontal dashed lines show the empirical means of ${x}_{1}$ and ${x}_{2}$ for that specific run, respectively. The horizontal and vertical widths of the gray rectangles show the confidence intervals (${\widehat{\mu}}_{{x}_{i}}\pm 1.96\times {\widehat{\sigma}}_{{x}_{i}}$) for both ${X}_{1}$ and ${X}_{2}$ based on 100 runs of 250 pairs each.

© 2018 by the author. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (http://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Vrins, F.
Sampling the Multivariate Standard Normal Distribution under a Weighted Sum Constraint. *Risks* **2018**, *6*, 64.
https://doi.org/10.3390/risks6030064

**AMA Style**

Vrins F.
Sampling the Multivariate Standard Normal Distribution under a Weighted Sum Constraint. *Risks*. 2018; 6(3):64.
https://doi.org/10.3390/risks6030064

**Chicago/Turabian Style**

Vrins, Frédéric.
2018. "Sampling the Multivariate Standard Normal Distribution under a Weighted Sum Constraint" *Risks* 6, no. 3: 64.
https://doi.org/10.3390/risks6030064