[Numpy-discussion] Correlated distributions (?)

Andrea Gavana andrea.gavana at gmail.com
Thu Aug 16 15:27:25 EDT 2012

Hi All,

    once again, my apologies for a (possibly) very ignorant question,
my google-fu is failing me... also because I am not sure of what
exactly I should look for.

My problem is relatively simple. Let's assume I have two Python
objects, A and B, and one of their attributes can assume a value of
"True" or "False" depending on the results of a uniform random
distribution sample, i.e.:

probability_A = 0.95
probability_B = 0.86

A.has_failed = False
B.has_failed = False

if numpy.random.random() < probability_A:
    A.has_failed = True

if numpy.random.random() < probability_B:
    B.has_failed = True

Now, I know that there is a correlation factor between the failing/not
failing of A and the failing/not failing of B. Specifically, If A
fails, then B should have 80% more chance of failing, but I have been
banging my head to find out how I should modify the "probability_B"
number (or the extremes of the uniform distribution, if that makes
sense) in order to reflect that correlation.

I have been looking at correlated distributions, but it appears that
most of the results I have found relate to normal distributions, there
is very little about non-normal (and especially uniform)

It's also very likely that I am not looking in the right direction, so
I would appreciate any suggestion you may share.

Thank you in advance.


"Imagination Is The Only Weapon In The War Against Reality."

More information about the NumPy-Discussion mailing list