Sampling the Multivariate Standard Normal Distribution Under a Weighted Sum Constraint
Total Page:16
File Type:pdf, Size:1020Kb
risks Technical Note Sampling the Multivariate Standard Normal Distribution under a Weighted Sum Constraint Frédéric Vrins ID Louvain Finance Center & CORE, Université catholique de Louvain, 1348 Louvain-la-Neuve, Belgium; [email protected] Received: 30 May 2018; Accepted: 22 June 2018; Published: 25 June 2018 Abstract: Statistical modeling techniques—and factor models in particular—are extensively used in practice, especially in the insurance and finance industry, where many risks have to be accounted for. In risk management applications, it might be important to analyze the situation when fixing the value of a weighted sum of factors, for example to a given quantile. In this work, we derive the (n − 1)-dimensional distribution corresponding to a n-dimensional i.i.d. standard Normal vector 0 0 0 Z = (Z1, Z2, ... , Zn) subject to the weighted sum constraint w Z = c, where w = (w1, w2, ... , wn) and wi 6= 0. This law is proven to be a Normal distribution, whose mean vector m and covariance matrix S are explicitly derived as a function of (w, c). The derivation of the density relies on the analytical inversion of a very specific positive definite matrix. We show that it does not correspond to naive sampling techniques one could think of. This result is then used to design algorithms for sampling Z under constraint that w0Z = c or w0Z ≤ c and is illustrated on two applications dealing with Value-at-Risk and Expected Shortfall. Keywords: conditional distribution; conditional sampling; multi-factor models 1. Introduction Factor models are extensively used in statistical modeling. In banking and finance, for instance, it is a standard procedure to introduce a dependence structure among loans (see, e.g., Li’s model Li(2016) , but also Andersen and Sidenius(2004); Hull and White(2004); Laurent and Sestier(2016); Vrins(2009), just to name a few). In the popular case of a one-factor Gaussian copula model, the default of the i-th entity is jointly driven by a common risk factor, say Y, as well as an idiosynchratic risk, all being independent and Normally distributed. In multi-factor models, the common factor is replaced by 0 a weighted sum of Normal risk factors Z˜ := (Z˜ 1, Z˜ 2, ... , Z˜ n) representing different aspects of the global economy (like region, sector, etc.). The random vector Z˜ can typically be expressed (via a Cholesky 0 decomposition) as a weighted sum of n (or less) i.i.d. standard Normal factors Z := (Z1, Z2, ... , Zn) . Interestingly, the asymptotic law (as the number of loans tends to infinity) of these portfolios can be derived analytically when only one systematic factor (n = 1) is considered (see Vasicek(1991) in the case of homogeneous pools and Gordy(2003) for an extension to heterogeneous pools). However, the case n > 1 requires numerical methods, typically Monte Carlo simulations. This raises the following question, whose practical interest will be illustrated with concrete examples: given a value 0 0 c of a common factor Y = w Z where w = (w1, w2, ... , wn) is a vector of non-zero weights, what is the distribution of Z ? In other words, how can we sample Z conditional upon Y = c ? It is of course straightforward to sample a vector Z of n Normal variables such that the weighted sum is c. One possibility is to sample a (n − 1)-dimensional i.i.d. standard Normal vector (Z1, Z2, ... , Zn−1) n−1 and then set Zn = (c − ∑i=1 wiZi)/wn (Method 1). Another possibility would be to draw a sample of a 0 0 n-dimensional i.i.d. standard Normal vector Q = (Q1, Q2, ... , Qn) and set Zi = Qi + (c − w Q)/(nwi) Risks 2018, 6, 64; doi:10.3390/risks6030064 www.mdpi.com/journal/risks Risks 2018, 6, 64 2 of 13 c (Method 2). Alternatively, one could just rescale such a vector and take Z = w0Q Q (Method 3). However, as discussed in Section3, none of these approaches yield the correct answer. Conditional sampling methods have already been studied in the literature. One example is of course sampling random variables between two bounds, which is a trivial problem solved by the inverse transform, see e.g., the reference books Glasserman(2010) or Rubinstein and Kroese(2017) . In the context of data acquisition, Pham(2000) introduces a clever algorithm to draw m samples from the n-dimensional Normal distribution N (m, S) subject to the constraint that the empirical (i.e., sample) mean vector mˆ (m) and covariance matrix Sˆ (m) of these m vectors agree with their theoretical counterparts m and S, respectively. Very recently, Meyer(2018) introduced a method to draw n-dimensional samples from a given distribution conditional upon the fact that q < n entries take known values. These works, however, do not provide an answer to the question we are dealing with. In particular, we do not put constraints on the average of sampled vectors, nor force some of their entries to take specific values, but instead work with a constraint on the weighted sum of the n entries of each of these vectors. In this paper, we derive the (n − 1)-dimensional conditional distribution associated with the 0 (w Z = c)-slice of the n-dimensional standard Normal density when wi 6= 0 for all i 2 f1, 2, ... , ng, n ≥ 2. More specifically, we restrict ourselves to derive the joint distribution of X = (X1, X2, ... , Xn), where Xi := wiZi (as the distribution of Z can be obtained by simple rescaling of that of X as X = DZ, where D is an invertible diagonal matrix satisfying Di,i = wi). The result derives from the analytical properties of a square positive definite matrix having a very specific form. We conclude the paper with two sampling algorithms and two illustrative examples. 2. Derivation of the Conditional Density The conditional distribution is derived by first noting that the conditional density takes the general form − n ! n 1 n ! fX ,...,X − ,Xn x1,..., xn−1, c − ∑ xi 1 n 1 i=1 fX ,...,Xn x1,..., xn Xi = c = d xi − c , (1) 1 ∑ f n (c) ∑ i=1 ∑i=1 Xi i=1 where d is the Dirac measure centered at 0. This expression is likely to be familiar to most readers but some technical details are provided in AppendixA. 0 n We shall show that the random vector X = (X1, ... , Xn) given ∑i=1 Xi = c is distributed as ˜ ˜ n−1 ˜ 0 ˜ ˜ ˜ 0 (X1, ... , Xn−1, c − ∑i=1 Xi) where the density of X = (X1, ... , Xn−1) is a multivariate Normal with mean vector m(c, w) and covariance matrix S(w) respectively given by cw2 m (c, w) := i , (2) i kwk2 w2 S (w) := i d kwk2 − w2 + (d − 1)w2 . (3) i,j kwk2 ij i ij j Note that, in these expressions, the indices i, j belong to f1, 2, ... , n − 1g and dij is the Kronecker symbol. The denominator of Equation (1) collapses to the univariate centered Normal density with n standard deviation kwk evaluated at c, noted f(c; 0, kwk). Similarly, when ∑i=1 xi = c, the numerator n−1 is just the product of univariate Normal densities. Using xn = c − ∑i=1 xi, n n−1 ! n−1 ∏ f(xi; 0, wi) = f c − ∑ xi; 0, wn ∏ f(xi; 0, wi) . i=1 i=1 i=1 Risks 2018, 6, 64 3 of 13 0 Hence, when the vector x = (x1, ... , xn) meets the constraint, (1) looks like a (n − 1)-th dimensional Normal pdf: n (x w ) ∏ f i; 0, i c2 ( n−1 ! n−1 ! 2 ) = 1 1 1 x 2c c i 1 = k(w) e 2kwk2 exp − + x2 + i x − x − , (4) ( k k) ∑ 2 2 i 2 ∑ j 2 i 2 f c; 0, w 2 i=1 wi wn wn j=1,j6=i wn 2wn where 1 kwk k(w) := p . n−1 n ( 2p) ∏i=1 wi On the other hand, the general expression of the Normal density of dimension n − 1 with mean 0 −1 vector m = (m1, ... , mn−1) and covariance matrix S whose inverse has entries noted by ai,j = (S )i,j can be obtained by expanding the matrix form of the multivariate Normal : ( n−1 n−1 n−1 n−1 !) 1 2 f(x; m, S) = K exp − ∑ ai,ixi + xi ∑ ai,jxj − xi ∑ (aj,i + ai,j)mj + mi ∑ ai,jmj , (5) 2 i=1 j=1,j6=i j=1 j=1 p where K := 1/ (2p)n−1jSj. To determine the expression of the covariance matrix and mean vector of the conditional density (4) (assuming it is indeed Normal), it remains to determine the entries of m and S−1 by inspection, comparing the expression of conditional density in (4) with that of the multivariate Normal (5) and then to obtain S by analytical inversion. Leaving only k(w) as a factor in front of the exponential in (4), the independent term (i.e., the term that does not appear as a factor of any xi) reads w.l.o.g. as n−1 2 2 2 2 ∑ wi 2 n−1 c c c = c − = − i 1 = − g w2 k k2 2 2 k k2 2 k k2 ∑ i i 2 w 2wn 2wn w 2wn w i=1 n−1 2 n−1 2 for any (g1, g2, ... , gn−1) satisfying ∑i=1 giwi = ∑i=1 wi (note that the constant case gi = 1 might be a solution, but it is not guaranteed at this stage). Comparing (4) and (5), it comes that the expression ! n−1 2 2 1 1 x 2c c giw + x2 + i x − x + i (6) 2 2 i 2 ∑ j 2 i 2 k k2 wi wn wn j=1,j6=i wn wn w must agree with n−1 n−1 n−1 2 ai,ixi + xi ∑ ai,jxj − xi ∑ (ai,j + aj,i)mj + mi ∑ ai,jmj (7) j=1,j6=i j=1 j=1 for all x1, x2, ..