Is there some method which will allow me to find some set of (random) numbers $z_1,\dots,z_n$ such that

$z_1 c_1 + z_2 c_2 + ... + z_n c_n = 0$

where for $k=1,\dots,n$, the $c_k$ are fixed coefficients and $z_k$ are realizations of a standard normal random variable? Many thanks in advance!

EDIT: The considered scenario is a multivariate normal distribution with known covariance matrix $\mathbf{\Sigma}$ and Cholesky decomposition $\mathbf{C}\mathbf{C'}=\mathbf{\Sigma}$. I am using a Monte-Carlo approach, where I am interested in all realizations of the vector $\mathbf{z} = (z_1, z_2,..., z_n)'$ where, using $\mathbf{x} = \mathbf{C}\mathbf{z}$, the value of $x_n = z_1 c_1 + z_2 c_2 + ... + z_n c_n$ is equal to zero. I hope this is a bit clearer.

  • $\begingroup$ Do you want the sum to be a random variable with mean zero, or do you want the sum to be equal to zero for every realization? In the second case I think you have no chance other than letting z_n be the deterministic solution to the linear equation. $\endgroup$ – Thomas Jun 13 '14 at 8:15
  • $\begingroup$ @Thomas the latter: the sum of the realizations should be zero. Could you please clarify the last part of you comment? How would I solve this? $\endgroup$ – ws6079 Jun 13 '14 at 8:18
  • $\begingroup$ It seems slightly unclear what you are asking. Do you need a joint distribution fo random variables $Z_1,\ldots,Z_n$ such that the marginal distribution of $Z_k$ is standard normal (for all $k$) and the linear combination is guaranteed to be 0? Or something else? It might help if you add some information about what you are trying to do. $\endgroup$ – Juho Kokkala Jun 13 '14 at 8:45
  • $\begingroup$ For the record, you should not refer to the collection of coefficients as "the $c_n$" because $c_n$ is the last coefficient. Better use "the $c_k$$ or some other free index. I submitted an edit to this end, but it needs to be reviewed. $\endgroup$ – Thomas Jun 13 '14 at 9:26
  • $\begingroup$ Based on the edit and the comments, I assume that you are asking how to produce samples from the conditional distribution of $z$ given $x_n=0$. The current wording is in my opinion still a bit strange - finding numbers that 'are realizations' is not clear. $\endgroup$ – Juho Kokkala Jun 13 '14 at 12:27

$z_1,\ldots,z_n,x_n$ together form a $n+1$-dimensional multivariate normal distribution. Proof: as $z$s are independent normal, linear combinations of them are normal. Furthermore, as $x_n$ is defined as a linear combination of the $z$s, any linear combination of the $z$s and $x_n$ is a linear combination of the $z$s and thus normal.

Mean of the multinormal distribution in question is $\mathbf{0}$. The covariance is such that the covariance of any $z_i,z_j$ is 0 if $i\neq j$ and 1 if $i=j$. Covariance of $z_i,x_n$ is $c_k$ and the variance of $x_n$ is $\sum_{k=1}^n c_n^2$. Now, to obtain the conditional distribution of $(z_1,\ldots,z_n)$ conditional on $x_n = 0$, we may directly apply the known equations for conditional distributions of multivariate normal distribution, with $\mathbf{x}_1 = (z_1,\ldots,z_n),~\mathbf{x}_2=x_n,\mathbf{a}=0$.

As the observed value 0 equals the mean of $x_n$, the conditional mean equals the unconditional mean, i.e., \begin{equation} E((z_1,\ldots,z_n) \mid x_n = 0 ) = (0,\ldots,0). \end{equation} To obtain the covariance, we need to evaluate the Schur complement, \begin{equation} \bar{\Sigma} = \Sigma_{11} - \Sigma_{12}\Sigma^{-1}_{22}\Sigma_{21}. \end{equation} Plugging in the values of the distribution in question, \begin{equation} = I_n - \begin{pmatrix} c_1 & \ldots & c_n \end{pmatrix}^T\left(\sum_{k=1}^n c_k^2\right)^{-1}\begin{pmatrix}c_1 & \ldots & c_n \end{pmatrix}. \end{equation} Evaluating this element by element, we get \begin{array}{lll} Cov(z_i,z_i) & = & 1 - \frac{c_i^2}{\sum_{k=1}^n c_k^2},& i \in \{1,\ldots,n\} \\ Cov(z_i,z_j) & = & - \frac{c_ic_j}{\sum_{k=1}^n c_k^2}, & i\neq j;~ i,j \in \{1,\ldots,n\}. \end{array}

Since the conditional distribution is multivariate normal, you can sample from it using standard methods, e.g., the Cholesky decomposition approach.


Let the $c_i$ be fixed and let $z_1,\dots,z_{n-1}$ be normal. Set $z_n := -\frac{1}{c_n} \sum_{i=1}^{n-1} c_i z_i$. These random variables satisfy the linear constraint by construction and since $z_n$ is a linear combination of standard normals it is normal itself.

  • $\begingroup$ A linear combination of standard normals is not guaranteed to be standard normal. $\endgroup$ – Juho Kokkala Jun 13 '14 at 8:39
  • $\begingroup$ Yes, right. I removed "standard". $\endgroup$ – Thomas Jun 13 '14 at 8:40
  • 1
    $\begingroup$ Without additional assumptions about the joint distribution of $z_1,\ldots,z_{n-1}$ (namely, that they are multivariate normal), the linear combination may be non-normal. $\endgroup$ – Juho Kokkala Jun 13 '14 at 8:42
  • $\begingroup$ Right, my problem is that I can not get the distribution of $z_n$ to meet my constraint (zero mean and unit-variance) $\endgroup$ – ws6079 Jun 13 '14 at 8:43
  • $\begingroup$ @JuhoKokkala for my scenario I know that the $z_n$ are uncorrelated and independent (for the unconditional case) $\endgroup$ – ws6079 Jun 13 '14 at 8:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.