I am trying to use the descriptive statistics feature of Mathematica to answer the following question: suppose I have two events, A and B, whose occurrence is described by a normal distribution around time $t_A$ and $t_B$ (with moments $\sigma_A$ and $\sigma_B$). What is the probability that, at a given time $t$, both events have occurred?

I have tried to define distributions and then use them in a construct of the form Probability[A && B, …], but it is clear from the documentation that Probability is not supposed to be used that way.

PS: I'm not so much interested in the mathematical solution (I have to read up on that subject, I'm really bad in statistics), rather in the way I can get Mathematica to solve this issue without me doing the maths :)

> (with moments $\sigma_A$ and $\sigma_B$) .................. Just as a clarification: $\sigma_A$ and $\sigma_B$ are not 'the moments'.
–
wolfiesApr 4 '13 at 14:04

There is a confusion in the topic as well... you don't want the descriptive statistics of two events, but simply the probability of occurence of two independently normally distributed variables.
–
RodApr 4 '13 at 18:28

4 Answers
4

For reasons @wolfies has amply made clear, it's wise to solve probability problems in Mathematica by getting as close to first principles as possible, rather than relying on black-box solutions (which tend to be much slower as well).

Assuming (as the O.P. implicitly does) that the events are independent, the axioms of probability assert that the chance both events have occurred is the product of their chances of occurring. By definition, the chance that an event has occurred by time $t$ is the value of its cumulative distribution function at $t$. Therefore, after consulting the help page to make sure about the parameterization of Normal distributions, we can reliably construct a correct answer as

To help understand it, let's plot (a) this function against time $t$ and (b) the two probability density functions for the events, allowing manipulation of the four parameters $t_A, \ldots, s_B$. The principal contribution of this code is to determine reasonable ranges for the plots automatically:

The illustration makes sense: there is essentially no probability of both events occurring before time $t=1$, when the event $B$ (red) first begins to have some visible chance of happening. At that point the chance of both events (left) rises rapidly because it's likely event $A$ (blue) has already occurred and the chance of event $B$ is rapidly increasing (as attested by the height of its density curve). By time $t=4$, the chance is good both events have already occurred, with some residual uncertainty about $A$ due to its wide spread. The righthand density plots appear correctly to represent Normal distributions with the given locations ($0$ and $2$) and spreads ($3$ and $1/2$, respectively) while the foregoing reasoning indicates the lefthand plot--our solution--correctly reflects the intended result.

The above answer by chris is unfortunately somewhat confused. I would prefer to make this as a comment, but the comment box does not allow for inputs and outputs, so this is the best I can do. I do not think it fair to apportion blame to the author, for the notation he has used is, in fact, entirely natural. It is also the notation used by the second answer! Rather, the fault lies with the Mathematica syntax for these distributions which is frankly appalling and internally inconsistent in its design. The author above (chris) is just another victim of that design.

In particular, the OP considers two Normal random variables, say X and Y, which Chris enters into Mathematica as:

In the case of independence, this is meant to have the property that CC = AA * BB. But due to a notation kerfuffle in the Mathematica implementation, this is not the case, and Chris' example has gone awry. The following should simplify to 1:

To get what he seeks, one would need to enter the bivariate Normal as:

The mistake has occurred for essentially 2 reasons: the first is the internally inconsistent syntax between the Normal and Multinormal in mma; the second is the use of 'black boxes' to denote distributional forms which can encourage people to use them without checking the actual output generated. A dangerous combo, as the answers above illustrate.

Mathematica is a registered trademark of Wolfram Research, Inc. While the mark is used herein with the limited permission of Wolfram Research, Stack Exchange and this site disclaim all affiliation therewith.