1
$\begingroup$

I would like to design a proposal of the form:

$$ p(t=(t_i)|\hat{t}=(\hat{t}_i)) $$

where $t$ (and $\hat{t}$) lies in an affine hyperplane $T \subset R^n$:

$$ t \in T \Leftrightarrow \sum_i t_i=1 $$

Ideally I would like to approach something like: $$ (t_i)| (\hat{t}_i) \sim \mathcal{N}((\hat{t}_i),\sigma^2 I) $$ with the constraint that $\sum_i t_i=1$ (or anything in a similar flavor).

An intuitive strategy could result in the following algorithm:

1) sample individually $\tilde{t}_i \sim \mathcal{N}(\hat{t_i},\sigma)$

2) then renormalise $t_i = \frac{\tilde{t}_i}{\sum_j \tilde{t}_j}$

but it seems to me a bit difficult to characterise the resulting proposal (and particularly to compute $\frac{p(t=(t_i)|\hat{t}=(\hat{t}_i))}{p(\hat{t}=(\hat{t}_i))|t=(t_i))}$ as I am applying it within a metropolis hasting algorithm).

Is anybody has an alternative proposal or some idea on how to deal with $\frac{p(t=(t_i)|\hat{t}=(\hat{t}_i))}{p(\hat{t}=(\hat{t}_i))|t=(t_i))}$ ?

Note: I deal with large $n$ ($T \subset R^n$) and thus need a quite efficient strategy.

$\endgroup$
5
  • 2
    $\begingroup$ The verbose notation gets in the way of the question itself. (Why on earth do you need two subscripts $i$ almost everywhere?) Are you just asking how to generate iid Normal samples efficiently on an affine subset of $\mathbb{R}^n$? $\endgroup$
    – whuber
    Commented Mar 11, 2013 at 16:25
  • $\begingroup$ @whuber Sorry for the subscripts: maybe a bad habit... If generating normal samples on an affine subset as a sense (I was a bit confused about that, which in part explains my over-extensive question); I am indeed just asking how to do it (and thanks for having clarified it). $\endgroup$
    – beuhbbb
    Commented Mar 12, 2013 at 8:36
  • 1
    $\begingroup$ The easiest way consists in generating a standard multivariate normal distribution of $\mathbb{R}^n$ and then to transform the sample by applying the projection matrix onto the subspace, and finally to add the "intercept". $\endgroup$ Commented Mar 12, 2013 at 10:25
  • $\begingroup$ @StéphaneLaurent Thanks. So the projection matrix $P$ writes in homogeneous coordinates : $$ \begin{pmatrix} 2/3& -1/3 & -1/3 & 1/3\\ -1/3& 2/3 & -1/3 & 1/3\\ -1/3& -1/3 & 2/3 & 1/3\\ 0 & 0 & 0 & 1 \\ \end{pmatrix}$$ So $t=P \tilde{t}$ with $\tilde{t} \sim N(\hat{t},\sigma^2 I)$. Is that right ? I am not confortable with the meaning of underlying pdf $p(t | \hat{t})$. Can you help me to understand it? $\endgroup$
    – beuhbbb
    Commented Mar 12, 2013 at 14:29
  • $\begingroup$ In, the previous comment I assumed a 3D case. $\endgroup$
    – beuhbbb
    Commented Mar 12, 2013 at 15:12

1 Answer 1

3
$\begingroup$

There are two general approaches: the implicit and the parametric. Stéphane Laurent describes the implicit method in a comment: generate a $N(\mu, \sigma^2\mathbb{I}_n)$ variate in $\mathbb{R}^n$ and project that orthogonally onto the affine subset. This works due to the spherical symmetry of the distribution in $\mathbb{R}^n$. A little computation is needed to choose $\mu$ correctly.

The implicit approach will be inefficient when $n$ is much larger than the dimension of the affine subspace. It also does not readily generalize to other multivariate normal distributions without a bit of work--and that work will be more extensive than the parametric method.

The parametric method chooses an origin $O$ (intended to be the mean) and orthonormal basis $(e_1, \ldots, e_d)$ for the affine subset $\mathbb{A}^d\in \mathbb{R}^n$. Generate a $N(0, \sigma^2\mathbb{I}_d)$ variate $y = (y_1, y_2, \ldots, y_d)$ and form

$$Y = y_1 e_1 + y_2 e_2 + \cdots + y_d e_d + O.$$

It should be obvious that this works and produces the desired result. Moreover, any desired covariance structure can be induced on this distribution by changing $\sigma^2\mathbb{I}_d$ to an arbitrary positive-definite symmetric matrix $\Sigma$; nothing else changes. Conceptually, all we have done is taken a $d$-dimensional multivariate normal distribution and moved it into $n$ dimensions via rotation and translation.

(The parametric method, then, easily generalizes to non-spherical and non-normal distributions whereas the implicit method does not, because the implicit method involves irrelevant random components distributed within the remaining $n-d$ dimensions that can make it difficult or impossible to achieve the desired distribution on $\mathbb{A}^d$.)

If (*) $\mathbb{A}^d$ is presented to you as the span of a set of vectors (and an origin), then the Gram-Schmidt process directly produces the $(e_i)$. Otherwise, if $\mathbb{A}^d$ is given as the solution of a set of linear equations (and an origin), then various well-known, widely-implemented algorithms will find a set of vectors spanning the kernel (null space) of those equations, putting us into the first situation (*).

$\endgroup$
6
  • $\begingroup$ Thanks ! Can you just explain "A little computation is needed to choose $\mu$ correctly" ? $\endgroup$
    – beuhbbb
    Commented Mar 12, 2013 at 15:46
  • $\begingroup$ Yes: when you project onto the affine subspace, $\mu$ (a vector in $\mathbb{R}^n$ gets projected somewhere. You need it to get projected to the mean of the distribution you desire on that subspace. If $\mathbb{P}$ is the orthogonal projection matrix and $\mu_d$ (in $\mathbb{A}^d$) is the intended mean, then you must find some value of $\mu$ for which $\mathbb{P}\mu = \mu_d$. $\endgroup$
    – whuber
    Commented Mar 12, 2013 at 15:50
  • $\begingroup$ "The parametric method chooses an origin O (intended to be the mean)". I would said that the mean is more related to the mean of the gaussian from which are drawn the $(y_i)$ and that the value of O is more concerned by the equation of the hyperplane. Am I right ? (maybe it is just a question of vocabulary...) $\endgroup$
    – beuhbbb
    Commented Mar 12, 2013 at 16:08
  • $\begingroup$ In either method you have to specify a mean for the distribution on $\mathbb{A}^d$ as well as the covariance structure there. When $\mathbb{A}^d$ is given implicitly as a set of solutions of linear equations, it inherits no distinguished origin. Similarly, when it is parameterized as the span of a basis plus some offset, it still has no distinguished origin. No matter what, you need to stipulate where in $\mathbb{A}^d$ the mean of your distribution is located. $\endgroup$
    – whuber
    Commented Mar 12, 2013 at 16:15
  • $\begingroup$ For the 1st method, why couldn't one generate a centered Gaussian and then adding $\mu_d$ after projection ? $\endgroup$ Commented Mar 12, 2013 at 20:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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