0

How does one calculate the probabilities of 2 outcomes that are negatively correlated (A happens and B happens, A happens and B doesn't happen, B happens and A doesn't happen, neither A or B happen)?

How does one calculate the probability of 2 outcomes that are negatively correlated?

I believe using the formula below, you can calculate the probability of 2 outcomes that are positively correlated (is this formula correct?), but I am not sure how to translate this to work with a negative correlation value: enter image description here

I assume these all use the formula below and you simply plugin in the different P(A) and P(B) values. Please correct me if that is wrong.

The formula doesn't seem to work with these values though (trying to solve for neither A or B occuring): A = 0.1 | B = 0.1 | Corr: -.72

When ever a = .1 and b=.1 and the correlation value is -.72, the formula above produces -0.0548, which doesn't seem right since the probability can't be negative, can it?

Assuming the correlation is 0, the probability should be, 0.01. With a negative correlation, wouldn't it be lower than 0.01? and with a positive correlation, it would be higher than 0.01?

Here is my python code being used: a * b + corr * math.sqrt(a * (1 - a) * b * (1 - b))

Isaac Byrne
  • 111
  • 6
  • You have discovered that not all combinations of $P(A),$ $P(B),$ and $\rho_{AB}$ are mathematically possible. The restriction is stated algebraically in my answer at https://stats.stackexchange.com/a/285008/919. It essentially says the combination is invalid when it produces a negative probability! – whuber May 23 '20 at 16:49
  • Thanks for helping! In your answer, is n the number of correlated events or the number of times you simulate the results to create an average? and p is essentially p(A) and q is essentially P(B)? – Isaac Byrne May 23 '20 at 16:52
  • As I recall, $p$ is the chance of the *complement* of $A$, so $p(A)=1-p.$ (These differences will not affect the correlation, however.) Similarly, $p(B)=1-q.$ In your case $n=1.$ – whuber May 23 '20 at 16:59
  • Thank you! So translating your solution into simple python script like so https://pyfiddle.io/fiddle/1c671f26-ccfb-4cda-9dcd-e559075202f4/?i=true produces the following probabilities (-0.002064954577220224 0.24206495457722021 0.6720649545772202 0.0879350454227798), they seem to match yours minus the negative one again? Any ideas where I am going wrong? – Isaac Byrne May 23 '20 at 17:16
  • My example used $q=0.75,$ not $q=0.76;$ and $\rho=-0.8,$ not $-0.811.$ You seem to be confusing the *observed* correlations in a *Binomial* dataset with the *hypothetical model* values for *Bernoulli* variables with which your question is concerned. – whuber May 23 '20 at 17:18
  • Hmm so is there any way to tweak the python code so that regardless of what I feed it (as long as the probabilties are valid, etc), it won't produce negative numbers? Feeding in proper q and corr value produce: 0.004613536474021268 0.24538646352597873 0.6653864635259786 0.08461353647402126 -- That seems more accurate to your results. Also thanks for helping! this has been stumping me like crazy! – Isaac Byrne May 23 '20 at 17:21
  • Let us [continue this discussion in chat](https://chat.stackexchange.com/rooms/108383/discussion-between-isaac-byrne-and-whuber). – Isaac Byrne May 23 '20 at 17:22
  • So with an ouput like (-0.002064954577220224 0.24206495457722021 0.6720649545772202 0.0879350454227798) I assume the number is negative because theoretically it would happen a negative amount of times, mean in practice its essential 0, since the sum of all the values still equals 1? – Isaac Byrne May 23 '20 at 17:35

0 Answers0