loveslave
asked on
How to add two normal distributions?
Is there an efficient way to add two normal distributions?
Let's say I have two multivariate normal distributions with means m1 and m2, and covariance matrices C1 and C2, and that the number of elements in each distribution is n1 and n2.
The mean of the sum of the distributions would then be
(m1 * n1 + m2 * n2) / (n1 + n2)
But is there an efficient way to calulate the new covariance matrix, other than iterating over all of the points of the two distributions? I have a feeling there should be, but I can't see it now.
Let's say I have two multivariate normal distributions with means m1 and m2, and covariance matrices C1 and C2, and that the number of elements in each distribution is n1 and n2.
The mean of the sum of the distributions would then be
(m1 * n1 + m2 * n2) / (n1 + n2)
But is there an efficient way to calulate the new covariance matrix, other than iterating over all of the points of the two distributions? I have a feeling there should be, but I can't see it now.
ASKER
Thanks a lot for your answer, but maybe I mis-phrased my question.
Both distributions have elements that are three-dimensional vectors (actually, they represent groups of points in 3D-space). So both C1, C2, and C12 are 3x3 matrices, right? What I'm after is to compute the covariance for the collection of all points in the two distributions. So the dimensionality is still the same, it's only the number of points that is bigger.
Both distributions have elements that are three-dimensional vectors (actually, they represent groups of points in 3D-space). So both C1, C2, and C12 are 3x3 matrices, right? What I'm after is to compute the covariance for the collection of all points in the two distributions. So the dimensionality is still the same, it's only the number of points that is bigger.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The b's above should be replaced with b1, b2, and b12 as appropriate.
x1 = n1 x 1 vector of variables in first distribution
x2 = n2 x 1 vector
C1 = n1 x n1 covariance matrix
C2 = n2 x n2 covariance matrix
You need to figure out the cross-covariance values between elements of x1 and elements of x2. If you can assume that the values are independent, then XC12 is all zeros.
XC12 = n1 x n2 cross-covariance matrix between x1 and x2
x12 = transpose(x1 x2)
C12 is the (n1+n2)x(n1+n2) covariance matrix for x12
C12 = [ C1 XC12 ]
[ transpose(XC12) C2 ]