Using the law of Total Probability and Baye's Theorem to Compute the Posterior Regime Probability of a market
Update trading beliefs after earnings, volatility, or macro signals arrive.
Before proceeding, let’s define some things.
Market Signal: Any piece of data that gives you any bit of insight into the cadence of the market.
Posterior Regime Probability: The calculated probability that a time series or system(in this case the market) is in a specific state / regime.
In this context, for simplicity, there are two basic market states: Bull || Bear and we are observing a market signal, “Strong Momentum”.
Under this problem, the following probabilities are given:
- Bull regime B: P(B)=0.60)
- Bear regime R: P(R)=0.40)
- P(S | B)=0.70 — in a bull market, the signal appears 70% of the time.
- P(S | R)=0.2 — in a bear market, the signal still appears 20% of the time.
Our objective: Calculate the probability, given it’s a bull market, that the Strong signal is present. Hence, the reason we call it Posterior(After) market probability.
Heads up, I will not be providing in-depth solutions here, just a logical breakdown and walkthrough. An in-depth overview with a solution was provided in the last essay.
In shorthand: P(B | S).
P(B | S) = P(B n S) / P(S)P(B n S) = P(S | B)P(B) = 0.7 * 0.6 = 0.42P(S) = P(S n B) + P(S n R).
If you are wondering why “P(S) = P(S n B) + P(S n R)” makes any sense. it is because these are the two events where S is bound to happen in either case and never alone without B and R events. The law of total probability states this.
P(S n R) = P(S | R) * P(R) = 0.2 * 0.4 = 0.08P(S) = 0.42 + 0.08 = 0.5P(B | S) = 0.42/0.5 = 0.84.
We just used Bayes Theorem to find P(B | S). It’s practically using reverse conditional probabilities to find what we need.
Note: These are notes from my learning journey; please do not implement the strategy with real money unless you know what you are doing.