2.2 — Conditional Outcomes and Applications
2.2 — Conditional Outcomes and Applications#
In the previous lesson (2.1), we learned the fundamentals of conditional probability and how it relates to dependent events. Now we’ll explore advanced applications of conditional probability, focusing on calculating probabilities of outcomes under various conditions and applying these concepts to complex financial scenarios. This lesson builds on the multiplication rule and chain rule from lesson 2.1.
Conditional Outcomes#
A conditional outcome is an outcome whose probability depends on the occurrence of another event. Understanding conditional outcomes is crucial for modeling dependent systems in quantitative finance.
Example 1: Market Regime Dependencies#
Consider stock returns that depend on market conditions:
-
Bull Market (probability 0.6):
- Stock goes up: 0.8
- Stock goes down: 0.15
- Stock unchanged: 0.05
-
Bear Market (probability 0.4):
- Stock goes up: 0.2
- Stock goes down: 0.7
- Stock unchanged: 0.1
Question: What is the unconditional probability that the stock goes up?
Solution using Law of Total Probability:
Let:
- = “Bull market”:
- = “Bear market”:
- = “Stock goes up”
Interpretation: The unconditional probability of the stock going up is 56%, which is a weighted average of the conditional probabilities.
Example 2: Portfolio Performance by Sector#
A portfolio contains stocks from two sectors:
-
Technology Sector (60% of portfolio):
- High return: 0.4
- Medium return: 0.5
- Low return: 0.1
-
Finance Sector (40% of portfolio):
- High return: 0.3
- Medium return: 0.4
- Low return: 0.3
Question: What is the probability of a high return from the portfolio?
Solution:
Let:
- = “Technology sector”:
- = “Finance sector”:
- = “High return”
Conditional Probability Trees#
Probability trees are visual tools for understanding conditional outcomes and complex probability scenarios.
Example: Trading Strategy Performance#
A trading strategy has two phases:
Phase 1: Signal Generation
- Strong signal: probability 0.3
- Weak signal: probability 0.7
Phase 2: Trade Execution (conditional on signal)
- If strong signal:
- Win: 0.7
- Loss: 0.3
- If weak signal:
- Win: 0.4
- Loss: 0.6
Probability Tree:
Win: 0.7
/
Strong: 0.3
/ \
/ Loss: 0.3
Start
\ Win: 0.4
\ /
Weak: 0.7
\
Loss: 0.6
Calculations:
Unconditional Win Probability:
Reversing Conditional Probabilities#
Sometimes we need to reverse conditional probabilities. For example, if we know , we might want to find .
Example: Credit Default Analysis#
A bank analyzes loan defaults:
- = “Borrower is high-risk”:
- = “Loan defaults”: (unconditional)
- (default probability for high-risk borrowers)
Question: If a loan defaults, what is the probability the borrower was high-risk?
Solution using conditional probability (we’ll learn this formally as Bayes’ Theorem in Chapter 3):
Interpretation: Among defaulted loans, 75% were from high-risk borrowers, even though high-risk borrowers only represent 10% of all borrowers.
Multiple Conditional Scenarios#
Real-world financial problems often involve multiple conditions and outcomes.
Example: Multi-Factor Risk Model#
A risk model considers three factors:
Factor 1: Market Volatility
- High volatility:
- Low volatility:
Factor 2: Economic Growth (conditional on volatility)
- If high volatility:
- Recession:
- Growth:
- If low volatility:
- Recession:
- Growth:
Factor 3: Portfolio Return (conditional on volatility and growth)
- If high volatility and recession:
- If high volatility and growth:
- If low volatility and recession:
- If low volatility and growth:
Question: What is the unconditional probability of a portfolio loss?
Solution:
We need to calculate probabilities for all combinations:
Now calculate loss probability:
Interpretation: The unconditional probability of a portfolio loss is 31.6%.
Conditional Expectations#
In quantitative finance, we often work with conditional expectations—the expected value of a random variable given that an event has occurred.
Example: Expected Return by Market Condition#
Stock returns depend on market conditions:
- Bull Market (probability 0.6):
- Expected return: 15%
- Bear Market (probability 0.4):
- Expected return: -5%
Unconditional Expected Return:
Interpretation: The unconditional expected return is 7%, which is a weighted average of the conditional expectations.
Financial Applications#
Risk-Adjusted Probabilities#
Example: Adjusting probabilities based on risk factors
- Base default probability:
- Given high leverage:
- Given economic downturn:
- Given both:
This allows for more accurate risk assessment under different scenarios.
Portfolio Optimization#
Example: Asset allocation based on market conditions
- In bull markets: Allocate 70% to stocks
- In bear markets: Allocate 30% to stocks
- In neutral markets: Allocate 50% to stocks
Conditional probabilities help determine optimal allocation strategies.
Trading Signal Analysis#
Example: Evaluating trading signals
- Signal accuracy in trending markets:
- Signal accuracy in ranging markets:
Understanding conditional probabilities helps assess signal reliability under different market conditions.
Python Implementation#
def law_of_total_probability(conditional_probs, prior_probs):
"""
Calculate unconditional probability using Law of Total Probability
P(B) = sum over i of P(B | A_i) * P(A_i)
Parameters:
conditional_probs: List of P(B | A_i) for each condition A_i
prior_probs: List of P(A_i) for each condition
Returns:
Unconditional probability P(B)
"""
if len(conditional_probs) != len(prior_probs):
raise ValueError("Lists must have same length")
return sum(c * p for c, p in zip(conditional_probs, prior_probs))
def conditional_expectation(conditional_expectations, prior_probs):
"""
Calculate unconditional expectation using Law of Total Expectation
E[X] = sum over i of E[X | A_i] * P(A_i)
Parameters:
conditional_expectations: List of E[X | A_i] for each condition A_i
prior_probs: List of P(A_i) for each condition
Returns:
Unconditional expectation E[X]
"""
if len(conditional_expectations) != len(prior_probs):
raise ValueError("Lists must have same length")
return sum(e * p for e, p in zip(conditional_expectations, prior_probs))
def probability_tree(levels):
"""
Calculate probabilities for a multi-level probability tree
Parameters:
levels: List of levels, where each level is a list of (probability, label) tuples
Returns:
Dictionary mapping paths to probabilities
"""
results = {}
def traverse(path, prob, level_idx):
if level_idx == len(levels):
results[tuple(path)] = prob
return
for branch_prob, label in levels[level_idx]:
new_path = path + [label]
new_prob = prob * branch_prob
traverse(new_path, new_prob, level_idx + 1)
traverse([], 1.0, 0)
return results
# Example 1: Market regime dependencies
conditional_probs = [0.8, 0.2] # P(up | bull), P(up | bear)
prior_probs = [0.6, 0.4] # P(bull), P(bear)
p_up = law_of_total_probability(conditional_probs, prior_probs)
print(f"P(stock up) = {p_up:.2f}")
# Example 2: Expected return
conditional_returns = [0.15, -0.05] # E[return | bull], E[return | bear]
expected_return = conditional_expectation(conditional_returns, prior_probs)
print(f"E[return] = {expected_return:.2%}")
# Example 3: Probability tree
levels = [
[(0.3, "Strong"), (0.7, "Weak")], # Phase 1
[(0.7, "Win"), (0.3, "Loss")], # Phase 2 (for strong)
[(0.4, "Win"), (0.6, "Loss")] # Phase 2 (for weak)
]
# Note: This is a simplified example. In practice, you'd need to handle
# different branches for different conditions
tree_results = {
("Strong", "Win"): 0.3 * 0.7,
("Strong", "Loss"): 0.3 * 0.3,
("Weak", "Win"): 0.7 * 0.4,
("Weak", "Loss"): 0.7 * 0.6
}
print("\nProbability Tree Results:")
for path, prob in tree_results.items():
print(f"{' -> '.join(path)}: {prob:.2f}")
p_win = tree_results[("Strong", "Win")] + tree_results[("Weak", "Win")]
print(f"\nP(Win) = {p_win:.2f}")
Common Mistakes#
-
Confusing conditional and unconditional probabilities
- Wrong: Using when you need
- Fix: Always identify what information is given
-
Incorrect application of Law of Total Probability
- Wrong: Not ensuring conditions are mutually exclusive and exhaustive
- Fix: Verify that and for
-
Reversing conditions incorrectly
- Wrong: Assuming
- Fix: Use the formula to reverse conditions (we’ll learn this as Bayes’ Theorem in Chapter 3)
-
Ignoring dependencies in probability trees
- Wrong: Using same probabilities for all branches
- Fix: Adjust probabilities based on previous outcomes
Key Takeaways#
- Conditional Outcomes: Outcomes whose probabilities depend on other events
- Law of Total Probability: for mutually exclusive, exhaustive
- Probability Trees: Visual tools for complex conditional scenarios
- Conditional Expectations:
- Financial Applications: Risk assessment, portfolio optimization, trading signals
Next Steps#
In the next chapter, we’ll learn Bayes’ Theorem and the Law of Total Probability formally, which provide powerful tools for updating probabilities and making decisions under uncertainty—essential skills for quantitative finance.