[R] Conditional Distribution of MVN variates
(Ted Harding)
Ted.Harding at nessie.mcc.ac.uk
Sun Jul 6 18:37:57 CEST 2003
Hi Folks,
Given k RVs with MVN distribution N(mu,S) (S a kxk covariance matrix),
let (w.l.o.g.) X1 denote the first r of them, and X2 the last (k-r).
Likewise, let mu1 and mu2 denote their respective expectations.
Then, of course, the expectation of X2 given X1=x1 is
mu2 + S21*inv(S22)*(x1 - mu1)
and the covariance matrix of X2 given X1=x2 is
S22 - S21*inv(X11)*S12
where Sij is the matrix derived from S by taking the rows corresponding
to the indices of Xi and the columns corresponding to the indices of Xj,
and these define the MVN conditional distribution of X2 given X1=x1.
While these are not difficult to write one's own functions for in R,
I feel almost sure that they already exist somewhere, if only I could
find them!
So, are there standard functions for this in R? If so, in what library?
With thanks,
Ted.
--------------------------------------------------------------------
E-Mail: (Ted Harding) <Ted.Harding at nessie.mcc.ac.uk>
Fax-to-email: +44 (0)870 167 1972
Date: 06-Jul-03 Time: 17:37:57
------------------------------ XFMail ------------------------------
More information about the R-help
mailing list