Back to Blog

Modeling Stock Market Volatility with Independent Economic Shocks: A Multivariate Stochastic Approach

Nov 30, 20258 min read
stochastic-processesGBMvolatilityMonte CarloS&P500SDEWiener-processconditional-distributions
Modeling Stock Market Volatility with Independent Economic Shocks: A Multivariate Stochastic Approach

Financial markets are one of the cleaner places to see stochastic processes escape the textbook. Prices move every day, but the uncertainty behind those moves is not all coming from one source. Some risk is market-wide, some is sector-specific, and some arrives as an external shock that does not politely wait for the model.

In this post, I build a three-variable volatility model around that idea. The variables are aggregate market returns, conditional sector volatility, and independent exogenous shocks. The goal is not to pretend this captures every feature of real markets, but to show how a carefully specified dependence structure gives us useful mathematics: joint density factorization, covariance structure, Monte Carlo diagnostics, and risk measures anchored to S&P 500 data.


Section 1: Mathematical Foundations - Geometric Brownian Motion

1.1 The GBM Stochastic Differential Equation

The starting point is geometric Brownian motion (GBM), the standard baseline model for asset price dynamics. For an asset price StS_t, GBM is specified by the stochastic differential equation:

dSt=μStdt+σStdWtdS_t = \mu S_t \, dt + \sigma S_t \, dW_t

where:

  • μ\mu is the drift coefficient (expected return rate)
  • σ\sigma is the volatility parameter (diffusion coefficient)
  • WtW_t is a standard Wiener process satisfying WtN(0,t)W_t \sim \mathcal{N}(0, t) with independent increments

The Wiener process WtW_t has the fundamental properties:

  • W0=0W_0 = 0 almost surely
  • WtWsN(0,ts)W_t - W_s \sim \mathcal{N}(0, t-s) for t>st > s
  • Increments Wt4Wt3W_{t_4} - W_{t_3} and Wt2Wt1W_{t_2} - W_{t_1} are independent for t1<t2t3<t4t_1 < t_2 \leq t_3 < t_4

1.2 Solving the SDE via Itô's Lemma

To solve this SDE, we apply Itô's lemma to f(St)=ln(St)f(S_t) = \ln(S_t). For a twice-differentiable function ff, Itô's lemma states:

df(St)=f(St)dSt+12f(St)(dSt)2df(S_t) = f'(S_t)dS_t + \frac{1}{2}f''(S_t)(dS_t)^2

With f(S)=ln(S)f(S) = \ln(S), we have f(S)=1/Sf'(S) = 1/S and f(S)=1/S2f''(S) = -1/S^2. Substituting:

dln(St)=1St(μStdt+σStdWt)121St2σ2St2dtd\ln(S_t) = \frac{1}{S_t}\left(\mu S_t \, dt + \sigma S_t \, dW_t\right) - \frac{1}{2} \cdot \frac{1}{S_t^2} \cdot \sigma^2 S_t^2 \, dt

dln(St)=(μσ22)dt+σdWtd\ln(S_t) = \left(\mu - \frac{\sigma^2}{2}\right) dt + \sigma \, dW_t

Integrating from 00 to tt:

ln(St)ln(S0)=(μσ22)t+σWt\ln(S_t) - \ln(S_0) = \left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t

This yields the closed-form solution:

St=S0exp[(μσ22)t+σWt]S_t = S_0 \exp\left[\left(\mu - \frac{\sigma^2}{2}\right)t + \sigma W_t\right]

1.3 Distribution of Log-Returns

For discrete time intervals Δt\Delta t, the log-return is:

rt=ln(St+ΔtSt)=(μσ22)Δt+σ(Wt+ΔtWt)r_t = \ln\left(\frac{S_{t+\Delta t}}{S_t}\right) = \left(\mu - \frac{\sigma^2}{2}\right)\Delta t + \sigma (W_{t+\Delta t} - W_t)

Since Wt+ΔtWtN(0,Δt)W_{t+\Delta t} - W_t \sim \mathcal{N}(0, \Delta t), we have:

rtN((μσ22)Δt,σ2Δt)r_t \sim \mathcal{N}\left(\left(\mu - \frac{\sigma^2}{2}\right)\Delta t, \, \sigma^2 \Delta t\right)

For daily returns with Δt=1/252\Delta t = 1/252 trading years, the daily variance is σ2/252\sigma^2/252 and the daily standard deviation is σ/252\sigma/\sqrt{252}.

1.4 Simulation Results

The animation below shows how quickly identical assumptions can lead to different realized paths. I simulate 20 GBM paths using parameters calibrated to S&P 500 data (μ=0.12\mu = 0.12, σ=0.214\sigma = 0.214 annualized).

GBM Path Evolution

Animation 1: Twenty GBM paths evolving over one trading year (252 days). All paths start at S0=100S_0 = 100 with identical parameters, but independent Brownian increments make them fan out over time. The spread grows with t\sqrt{t}, as predicted by the diffusion term.

The static analysis is consistent with the model's theoretical predictions:

Figure 1: Geometric Brownian Motion FoundationsFigure 1: Geometric Brownian Motion Foundations

Figure 1: GBM foundations. Top left: multiple price paths with the characteristic fan-out pattern. Top right: log-return distribution closely matching the theoretical N(μM,σM2)\mathcal{N}(\mu_M, \sigma_M^2). Bottom left: terminal prices with the expected lognormal right skew. Bottom right: rolling volatility fluctuating around the calibrated σ = 21.4%.


Section 2: The Three-Variable Model

GBM gives us a useful base model, but it is too compressed for the question I care about here. To separate different kinds of uncertainty, I use three random variables, each with its own distribution and dependence assumptions.

2.1 Variable 1: Market Returns RMR_M

Let RMR_M represent daily log-returns on the aggregate market index, here the S&P 500. Under the GBM assumptions:

RMN(μM,σM2)R_M \sim \mathcal{N}(\mu_M, \sigma_M^2)

Calibration to S&P 500 (2020-2024):

  • Sample size: 1,256 trading days
  • Estimated daily drift: μM=0.000474\mu_M = 0.000474
  • Estimated daily volatility: σM=0.013504\sigma_M = 0.013504
  • Annualized volatility: σM25221.4%\sigma_M \cdot \sqrt{252} \approx 21.4\%

2.2 Variable 2: Sector Volatility VSV_S (Conditional Specification)

Sector-specific volatility should not be independent of market conditions. When the market moves sharply, sector volatility often rises too. I model that dependence with a conditional log-normal specification:

VSRMLogNormal(α+βRM,τ2)V_S \mid R_M \sim \text{LogNormal}(\alpha + \beta |R_M|, \, \tau^2)

Equivalently, the logarithm of sector volatility is conditionally normal:

log(VS)RMN(α+βRM,τ2)\log(V_S) \mid R_M \sim \mathcal{N}(\alpha + \beta |R_M|, \tau^2)

The absolute value RM|R_M| captures a symmetric market-magnitude effect: large market moves in either direction tend to increase sector volatility. This is related to volatility clustering, but it is not a full leverage-effect model because negative and positive returns enter with the same magnitude.

Model Parameters: These values are illustrative scenario parameters chosen to make the dependence structure visible. The market return parameters are calibrated from S&P 500 data; α\alpha, β\beta, and τ\tau are not separately estimated from sector data in this post.

  • α=3.5\alpha = -3.5 (baseline log-volatility)
  • β=15.0\beta = 15.0 (sensitivity to market magnitude)
  • τ=0.3\tau = 0.3 (idiosyncratic volatility noise)

The conditional expectation is:

E[VSRM=r]=exp(α+βr+τ22)\mathbb{E}[V_S \mid R_M = r] = \exp\left(\alpha + \beta|r| + \frac{\tau^2}{2}\right)

This creates a U-shaped relationship. E[VSRM]\mathbb{E}[V_S \mid R_M] is minimized when RM=0R_M = 0 and increases as RM|R_M| grows.

The next animation makes that conditional structure easier to see. As RMR_M moves away from zero, the distribution of VSRMV_S | R_M shifts toward higher volatility:

Conditional Distribution Sweep

Animation 2: Conditional distributions VSRMV_S|R_M sweeping from RM=0.03R_M = -0.03 to +0.03+0.03. Left panel: the distribution shifts rightward as RM|R_M| increases. Right panel: the red line tracks the current RMR_M on the joint density heatmap. The info bar shows the U-shaped conditional expectation.

2.3 Variable 3: Exogenous Shock ZZ (Independent)

The third variable represents events outside the day-to-day market mechanism: geopolitical disruptions, policy surprises, or sudden sector-specific news. I treat this component as structurally independent of the normal market-return and sector-volatility variables.

I model ZZ as a compound Poisson process:

Z=i=1NJiZ = \sum_{i=1}^{N} J_i

where:

  • NPoisson(λ)N \sim \text{Poisson}(\lambda) counts the number of shocks (jumps) per period
  • JiN(μJ,σJ2)J_i \sim \mathcal{N}(\mu_J, \sigma_J^2) are i.i.d. jump magnitudes
  • λ=0.05\lambda = 0.05 (5% daily probability of a shock)
  • μJ=0\mu_J = 0, σJ=0.02\sigma_J = 0.02

Critical Independence Assumption:

Z ⁣ ⁣ ⁣(RM,VS)Z \perp\!\!\!\perp (R_M, V_S)

The exogenous shock is statistically independent of both market returns and sector volatility. This is a modeling assumption, not a claim that every real-world shock is perfectly isolated. The point is to study what becomes possible when one risk source can be separated cleanly from the others.

Jump Process Evolution

Animation 3: Compound Poisson jump process over 252 trading days. Top: cumulative shock value Z(t)Z(t) with discrete jumps marked by red stars. Between jumps, Z(t)Z(t) remains constant because there is no continuous drift component. Bottom: jump counting process N(t)N(t) following Poisson(λ), with the empirical jump rate converging toward the theoretical 5%.


Section 3: Independence and Joint Distributions

The independence assumption for ZZ is where the model becomes especially useful. It gives the joint distribution a simple factorization and creates a covariance matrix with a clean separated block.

3.1 Joint Density Factorization

For random variables XX and YY, independence implies fX,Y(x,y)=fX(x)fY(y)f_{X,Y}(x,y) = f_X(x) \cdot f_Y(y).

In our three-variable system:

fRM,VS,Z(r,v,z)=fRM,VS(r,v)fZ(z)f_{R_M, V_S, Z}(r, v, z) = f_{R_M, V_S}(r, v) \cdot f_Z(z)

The important subtlety is that only the shock variable separates. The joint density of (RM,VS)(R_M, V_S) does not factorize because sector volatility is conditional on market returns:

fRM,VS(r,v)=fVSRM(vr)fRM(r)fVS(v)fRM(r)f_{R_M, V_S}(r, v) = f_{V_S|R_M}(v|r) \cdot f_{R_M}(r) \neq f_{V_S}(v) \cdot f_{R_M}(r)

This partial-independence structure is common in financial modeling: one part of the system is linked internally, while another component is treated as independent.

3.2 Covariance Under Independence

Independence between ZZ and the market variables gives zero covariance:

Cov(RM,Z)=E[RMZ]E[RM]E[Z]=E[RM]E[Z]E[RM]E[Z]=0\text{Cov}(R_M, Z) = \mathbb{E}[R_M Z] - \mathbb{E}[R_M]\mathbb{E}[Z] = \mathbb{E}[R_M]\mathbb{E}[Z] - \mathbb{E}[R_M]\mathbb{E}[Z] = 0

Similarly, Cov(VS,Z)=0\text{Cov}(V_S, Z) = 0.

The pair (RM,VS)(R_M, V_S) is different. Because VSV_S is defined conditionally on RMR_M, their covariance is not forced to be zero. Using the law of total covariance:

Cov(RM,VS)=E[Cov(RM,VSRM)]+Cov(E[RMRM],E[VSRM])\text{Cov}(R_M, V_S) = \mathbb{E}[\text{Cov}(R_M, V_S | R_M)] + \text{Cov}(\mathbb{E}[R_M|R_M], \mathbb{E}[V_S|R_M])

Since Cov(RM,VSRM)=0\text{Cov}(R_M, V_S | R_M) = 0 (conditioning on RMR_M makes RMR_M fixed):

Cov(RM,VS)=Cov(RM,exp(α+βRM+τ22))\text{Cov}(R_M, V_S) = \text{Cov}\left(R_M, \exp\left(\alpha + \beta|R_M| + \frac{\tau^2}{2}\right)\right)

With a perfectly symmetric zero-mean return distribution, the covariance between RMR_M and an even function of RMR_M could vanish. In this calibrated setting, the small positive drift and finite-sample simulation produce a small positive empirical covariance. The stronger point is dependence: VSV_S changes with RM|R_M|, while ZZ remains separate.

3.3 The Block-Diagonal Covariance Matrix

The full covariance matrix exhibits block-diagonal structure:

Σ=(σM2Cov(RM,VS)0Cov(RM,VS)Var(VS)000Var(Z))\Sigma = \begin{pmatrix} \sigma_M^2 & \text{Cov}(R_M, V_S) & 0 \\ \text{Cov}(R_M, V_S) & \text{Var}(V_S) & 0 \\ 0 & 0 & \text{Var}(Z)\end{pmatrix}

The zeros in the third row and column are direct consequences of independence. This structure gives us:

  1. Factored computation: Joint probabilities decompose into products
  2. Risk separation: Exogenous shock exposure can be modeled as a separate risk component
  3. Simplified inference: Parameters can be estimated separately

3.4 Simulation Diagnostics

With 100,000 Monte Carlo simulations, we can check whether the simulated data behaves the way the assumptions say it should. These are diagnostics, not proofs: low correlation and high Spearman p-values are consistent with the simulated independence assumption for ZZ, but they do not establish independence in general.

Correlation Analysis:

RelationshipEmpirical correlationCalibrated expectation
RMR_M and ZZ0.0020
VSV_S and ZZ0.0010
RMR_M and VSV_S0.025>0> 0

Spearman Rank Correlation Tests:

Relationshipρ\rhop-valueDecision
RMR_M vs. ZZ0.0020.91Consistent with simulated independence
VSV_S vs. ZZ0.0010.88Consistent with simulated independence
RMR_M vs. VSV_S0.024<0.001< 0.001Detects modeled dependence

Independence DiagnosticsIndependence Diagnostics

Figure 2: Independence diagnostics. Top row: scatter plots with 2σ confidence ellipses. The (RM,VS)(R_M, V_S) pair shows the modeled dependence, while the pairs involving ZZ stay close to uncorrelated. Bottom left: correlation matrix with near-zero entries for ZZ. Bottom middle: block-diagonal covariance structure. Bottom right: Spearman p-values that are consistent with, but do not prove, the simulated independence assumption for ZZ.

The joint density also becomes visible as the Monte Carlo sample grows:

Joint Density Heatmap Build-up

Animation 4: Joint density f(RM,VS)f(R_M, V_S) emerging from 100 to 10,000 samples. White points show raw samples; contour colors reveal where density concentrates. The characteristic shape, with higher density near RM=0R_M = 0 and lower VSV_S, then wider spread for larger RM|R_M|, visualizes the conditional dependence structure.


Section 4: Simulation Framework with S&P 500 Data

4.1 Data and Calibration

For calibration, I use S&P 500 (^GSPC) daily data from January 2020 to December 2024. This window is useful because it contains several distinct regimes: the COVID-19 crash, the recovery, the 2022 bear market, and the 2023-24 rally.

S&P 500 Evolution

Animation 5: Historical S&P 500 price evolution, normalized to base 100, with synchronized 20-day rolling volatility. Key events are annotated: COVID crash bottom in March 2020, 2022 bear market onset, and the 2023 rally. Volatility clusters during crises and mean-reverts during calmer periods.

Parameter Summary: Market return parameters are calibrated from S&P 500 data; the sector-volatility parameters are illustrative settings for the conditional model.

ComponentParameterValueInterpretation
Market returnsμM\mu_M0.000474Daily drift
Market returnsσM\sigma_M0.013504Daily volatility (21.4% annualized)
Sector volatilityα\alpha-3.5Illustrative baseline
Sector volatilityβ\beta15.0Illustrative magnitude sensitivity
Sector volatilityτ\tau0.3Illustrative idiosyncratic noise
Exogenous shocksλ\lambda0.05Jump intensity (5% daily)
Exogenous shocksμJ\mu_J0.0Mean jump size
Exogenous shocksσJ\sigma_J0.02Jump volatility

4.2 Historical Context

Historical DataHistorical Data

Figure 3: S&P 500 empirical data (2020-2024). Top: price evolution showing the COVID crash, recovery, and later regimes. Bottom left: return distribution with a fitted normal, including slight excess kurtosis. Bottom right: rolling 20-day volatility showing regime changes and clustering.


Section 5: Risk Assessment - VaR and Expected Shortfall

5.1 Portfolio Loss Function

To connect the model to risk measurement, define portfolio loss as:

L=w1RMw2log(VS)+w3ZL = -w_1 R_M - w_2 \log(V_S) + w_3 |Z|

where (w1,w2,w3)=(1.0,0.5,0.3)(w_1, w_2, w_3) = (1.0, 0.5, 0.3) are exposure weights. This is a stylized loss definition rather than a universal portfolio convention: positive market returns reduce loss, the log-volatility term captures exposure to sector conditions, and the absolute shock term treats shocks in either direction as costly.

5.2 Value at Risk (VaR)

For confidence level α\alpha, Value at Risk is defined as:

VaRα=FL1(α)=inf{l:P(Ll)α}\text{VaR}_\alpha = F_L^{-1}(\alpha) = \inf\{l : P(L \leq l) \geq \alpha\}

Because LL combines returns, log-volatility, absolute shocks, and arbitrary exposure weights, the reported VaR values are in model loss units. They should not be read directly as percentages or dollar losses.

Simulation Results:

Confidence levelValue at Risk (model loss units)
90%1.8750
95%1.9336
99%2.0388

5.3 Expected Shortfall (Conditional VaR)

Expected Shortfall looks past the threshold and measures the average loss in the tail:

ESα=E[LLVaRα]\text{ES}_\alpha = \mathbb{E}[L \mid L \geq \text{VaR}_\alpha]

Simulation Results:

Confidence levelExpected Shortfall (model loss units)
90%1.9504
95%1.9987
99%2.0918

Here ESα>VaRα\text{ES}_\alpha > \text{VaR}_\alpha, as expected, because ES accounts for the severity of losses beyond the VaR threshold.

5.4 Variance Decomposition

The independence structure also makes the variance decomposition readable:

Var(L)=w12Var(RM)+w22Var(logVS)+w32Var(Z)+2w1w2Cov(RM,logVS)\text{Var}(L) = w_1^2 \text{Var}(R_M) + w_2^2 \text{Var}(\log V_S) + w_3^2 \text{Var}(|Z|) + 2w_1 w_2 \text{Cov}(R_M, \log V_S)

Empirical Decomposition:

ComponentContribution
Total variance0.02640
Market (RMR_M)0.7%
Sector (VSV_S)98.9%
Exogenous (ZZ)0.0%
Cross-term0.4%

Under these particular weights, sector volatility dominates the loss variance. That does not mean market returns or shocks are unimportant in every portfolio; it means this exposure profile is most sensitive to the sector-volatility term.

Risk Distribution Evolution

Animation 6: Portfolio loss distribution building from 100 to 10,000 simulations. Left: histogram with VaR thresholds (90%, 95%, 99%) stabilizing. Right: VaR (red) and ES (blue) convergence, showing Monte Carlo estimation consistency.

Risk AnalysisRisk Analysis

Figure 4: Risk assessment summary. Top left: final loss distribution with VaR/ES markers. Top right: tail exceedance probability on a log scale. Bottom left: variance decomposition showing sector volatility dominance. Bottom middle: component-wise VaR contributions. Bottom right: Q-Q plot showing approximate normality with slight tail deviation.


Section 6: Extensions and Limitations

6.1 Potential Extensions

Stochastic Volatility (Heston Model): Replace fixed volatility with a mean-reverting process: dVt=κ(θVt)dt+ξVtdWtVdV_t = \kappa(\theta - V_t)dt + \xi\sqrt{V_t}dW_t^V

Regime Switching: Allow parameters to switch between states, such as bull and bear markets, governed by a Markov chain.

Copula-Based Dependence: Replace conditional specification with flexible copula structures for (RM,VS)(R_M, V_S).

6.2 Limitations

  1. Independence assumption: True exogeneity is rare in interconnected markets
  2. Parameter stability: Calibrated parameters may change across regimes
  3. Log-normal sector volatility: May not capture all empirical features
  4. Jump timing: Compound Poisson assumes independent, identically distributed arrival times

Conclusion

This project started as a way to make the independence assumption concrete. Instead of saying "some shocks are independent" in words, the model makes that claim visible in the joint density, covariance matrix, and simulation output.

Key Technical Contributions:

  1. Joint density factorization: Independence of ZZ enables f(r,v,z)=f(r,v)f(z)f(r,v,z) = f(r,v) \cdot f(z), simplifying both analytical derivations and computational implementation.

  2. Block-diagonal covariance: Zero covariances involving ZZ support clean risk decomposition and separate treatment of exogenous shock exposure.

  3. Simulation diagnostics: 100,000 Monte Carlo simulations produce diagnostics consistent with the simulated independence setup for ZZ (correlations ≈ 0, Spearman p-values > 0.05) and the modeled dependence between RMR_M and VSV_S.

  4. Risk decomposition: Variance attribution shows that sector volatility dominates portfolio risk under the chosen weights, with exogenous shocks contributing marginally.

  5. Calibration to real data: S&P 500 data (2020-2024) provides empirical grounding with annualized volatility σ ≈ 21.4%, consistent with post-COVID market regimes.

Combining GBM dynamics, conditional distributions, compound Poisson shocks, and explicit independence assumptions gives a framework that is analytically tractable and empirically grounded. For practitioners, the independence assumption should always be tested against the use case. For researchers, stochastic volatility, regime switching, and richer dependence models are natural next steps.

The central insight is simple but powerful: different sources of market risk interact in structured ways. Knowing which risks move together, and which can be treated separately, makes risk management and portfolio construction much more precise.


References and Further Reading

  • Black, F. & Scholes, M. (1973). The Pricing of Options and Corporate Liabilities. Journal of Political Economy.
  • Heston, S.L. (1993). A Closed-Form Solution for Options with Stochastic Volatility. Review of Financial Studies.
  • Merton, R.C. (1976). Option Pricing When Underlying Stock Returns Are Discontinuous. Journal of Financial Economics.
  • Cont, R. (2001). Empirical Properties of Asset Returns: Stylized Facts and Statistical Issues. Quantitative Finance.

Prepared for CSI 5138: Stochastic Processes
Visualizations are generated from Monte Carlo simulations using S&P 500-calibrated market parameters and illustrative sector/shock assumptions