comparison toolboxes/FullBNT-1.0.7/KPMstats/condGaussToJoint.m @ 0:cc4b1211e677 tip

initial commit to HG from Changeset: 646 (e263d8a21543) added further path and more save "camirversion.m"
author Daniel Wolff
date Fri, 19 Aug 2016 13:07:06 +0200
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:cc4b1211e677
1 function [muXY, SigmaXY] = condGaussToJoint(muX, SigmaX, muY, SigmaY, WYgivenX)
2
3 % Compute P(X,Y) from P(X) * P(Y|X) where P(X)=N(X;muX,SigmaX)
4 % and P(Y|X) = N(Y; WX + muY, SigmaY)
5
6 % For details on how to compute a Gaussian from a Bayes net
7 % - "Gaussian Influence Diagrams", R. Shachter and C. R. Kenley, Management Science, 35(5):527--550, 1989.
8
9 % size(W) = dy x dx
10 dx = length(muX);
11 dy = length(muY);
12 muXY = [muX(:); WYgivenX*muX(:) + muY];
13
14 W = [zeros(dx,dx) WYgivenX';
15 zeros(dy,dx) zeros(dy,dy)];
16 D = [SigmaX zeros(dx,dy);
17 zeros(dy,dx) SigmaY];
18
19 U = inv(eye(size(W)) - W')';
20 SigmaXY = U' * D * U;
21
22