0

I am working in R and have a matrix (200X3) named X where I have simulated data from a multivariate normal distribution given its parameters (variance-covariance matrix & and mu). My task is to calculate conditional probabilities P(X1>1/X2=1, X3=-2) and P(X1>1/X2+X3=-1)where X1,X2 and X3 the 1st,2nd and 3rd columns of X. I would really appreciate some tips.

Thanks a lot in advance.

  • 2
    Well, do you know mathematically how to do that? That sounds more like a statistics homework question than a programming question. if you need help with statistics, you should ask your question at [stats.se] instead. Questions here should have a [reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) with sample input, desired output, and your code attempts thus far. R is more of a calculator rather than a magic statistics machine; you need to clearly tell it what you want to compute. – MrFlick Dec 03 '19 at 15:57
  • Well I suppose i could use Bayes theorem, but still i dont know how to calculate probability of a joint distribution in R when my samples are from a multivariate normal distribution – P.Crystallides Dec 03 '19 at 16:27
  • The conditional distribution of any subset of jointly Gaussian variables is again Gaussian, with mean and variance derived from the joint distribution. It's a standard result; I seem to recall seeing it in Chapter VIII of "Theory of Probability" by R. von Mises. A web search should find the formula. – Robert Dodier Dec 03 '19 at 19:07
  • appreciate the tip, will look online for this book, thanks a lot! – P.Crystallides Dec 04 '19 at 12:42

0 Answers0