I often need to do calculations such as the following:
- A, B, C, D are independent random variables distributed uniformly in [0,1].
- X := A+B and Y:=B+C+D.
- What is the probability that X < Y?
- What is the expected value of Y, given that Y < 2?
- etc...
I thought that it might be possible with Python scipy, since it has a random-variable class. But, I did not find e.g. how to create a random-variable that is the sum of two given random-variables, or the conditional distribution of another variable.
Is there another library tool that can do such calculations easily?
Note: I asked a similar question in math.SE, with no replies so far.
Aucun commentaire:
Enregistrer un commentaire