# Simulate Gaussian variables conditional on their sum of squares

Consider a $d$-dimensional Gaussian random vector $\mathbf{Z}=[Z_i]_i$ with mean $\boldsymbol{\mu}$ and covariance matrix $\boldsymbol{\Sigma}$. What would be the more efficient method(s) to simulate $\mathbf{Z}$ conditional on the sum of squares of its components $Y := Z_1^2 + Z_2^2 + \dots + Z_d^2$? The independent case with $\boldsymbol{\Sigma}$ diagonal can be of interest.

My first simple attempt is via importance sampling using as importance distribution a Von Mises distribution on the sphere $\{\mathbf{z}: \: \|\mathbf{z}\|^2 = Y\}$ with pdf $g(\mathbf{z}) \propto \exp\{ \boldsymbol{\theta}^\top \mathbf{z}\}$, choosing $\boldsymbol{\theta} = \boldsymbol{\Sigma}^{-1}\boldsymbol{\mu}$. This question relates to my question about the chi-square process.

• Importance sampling does not allow you to simulate a given distribution but only and at best to approximate moments from this distribution. To simulate exactly from your target, you should seek an accept-reject method, using a proposal that is supported by the sphere. Jun 27, 2017 at 12:46
• @Xi'an. Oh yes, thank you. I had in mind using particles for the specific filtering problem, hence using resampling. A concern is the ratio of the two pdf, which can be computed exactly with for the Von Mises'.
– Yves
Jun 27, 2017 at 14:56
• But can the ratio be bounded? This is the important issue for exact simulation. Actually, given the von Mises density, it is likely to be bounded. Jun 27, 2017 at 15:43
• I think that when $\boldsymbol{\theta}$ is chosen as I proposed the ratio of pdf target / proposal is $\propto \exp\{-\mathbf{z}^\top \boldsymbol{\Sigma}^{-1} \mathbf{z} / 2\}$ so the maximum and minimum relate to those of the Rayleigh quotient hence to the eigenvalues of $\boldsymbol{\Sigma}$. When $\boldsymbol{\Sigma}$ is scalar the ratio is constant hence must be $1$.
– Yves
Jun 27, 2017 at 17:04
• I'd be interesting in seeing this even for the cases with $d=2$; $\mu=(1,1)$ or $\mu=(0,1)$; $\Sigma=\pmatrix{1 & 0\\0 & 1}$ May 9, 2021 at 2:42