I have two vectors of dimension n and I would to impose a prior distribution such that…
- User
I have two vectors of dimension n and I would to impose a prior distribution such that the sum of each vector equals 1 and both vectors are orthogonal. Which prior can I use ?
- Assistant
One prior distribution that can be used to satisfy these conditions is the Dirichlet distribution. The Dirichlet distribution is a multivariate distribution that produces vectors of length n, where each element is a positive value between 0 and 1 and the sum of all elements is 1.
To ensure that the two vectors are orthogonal, we can use a prior distribution that produces vectors that have a dot product of zero. One such prior is the multivariate normal distribution with a covariance matrix that is a diagonal matrix with alternating positive and negative values. For example, if n=4, the covariance matrix would be:
css[ 1 0 -1 0 ] [ 0 1 0 -1 ] [-1 0 1 0 ] [ 0 -1 0 1 ]Using these priors, we can generate two vectors that satisfy the desired conditions. First, we can generate a vector from the Dirichlet distribution, and then we can generate a vector from the multivariate normal distribution with the specified covariance matrix. Finally, we can normalize the vectors to ensure that their sum equals 1.
- User
What is the distribution of a normal distribution of dimension 2n such that the sum of the first n is one and the sum of the last n is one and both n vectors are independent ?
- Assistant
To construct a normal distribution of dimension 2n that satisfies the given conditions, we can use the following approach:
- First, we can generate two independent normal distributions of dimension n, where the mean of each distribution is zero and the variance is arbitrary.
- We can then transform these distributions to ensure that the sum of the first n elements is one and the sum of the last n elements is one. One way to do this is to normalize each vector by its sum and then multiply by a scalar such that the sum is one. Specifically, if X and Y are the two normal vectors, we can define:
scssU = X / sum(X) * sqrt(n/2) V = Y / sum(Y) * sqrt(n/2)Here, U and V are the transformed vectors that satisfy the condition that the sum of the first n elements is one and the sum of the last n elements is one. The factor
sqrt(n/2)is used to ensure that the variances of U and V are equal to one.- Finally, we can combine U and V to obtain the desired 2n-dimensional normal distribution. Specifically, we can define: