# How do I estimate the joint probability of stock B moving, if stock A moves?

I have two stocks, A and B, that are correlated in some way.

If I know (hypothetically) that stock A has a 60% chance of rising tomorrow, and I know the joint probability between stocks A and B, how do I calculate the probability of stock B moving tomorrow?

For bonus upvotes - do you know of any standard libraries that can calculate the joint probability of stocks A and B, given a time series of historical data?

Update:

The phrase "conditional probability" is also applicable.

-

So you want to calculate $\mathbb{P}[B_1 > B_0 + \varepsilon \;|\; A_1 > A_0 + \varepsilon]$? If you truly have the joint distribution of $A_1$ and $B_1$ and the current prices $A_0$ and $B_0$, this just becomes a simple exercise in integration, by the definition of probability density. Are you asking how to find a conditional probability in general, or is your question about something else?

-
 Interesting. Calculating integrals is not that difficult, thanks or the tip. – Gravitas Jul 9 '11 at 11:38

Why not using the so simple Monte-Carlo estimator

$\hat{p}_N =\frac{ \sum_{i=1}^N 1_{|A_{i+1}-A_i|>0 \cap |B_{i+1}-B_i|>0}} {\sum_{i=1}^N 1_{|A_{i+1}-A_i|>0 }}$

where $1_{|A_{i+1}-A_i|>0}$ is $1$ if stock $A$ has moved at time $i+1$

-

...do you know of any standard libraries that can calculate the joint probability of stocks A and B, given a time series of historical data?

Using R and the LSPM package with the code posted here might be what you are looking for.

-