S&P 5005,983+0.49%
NASDAQ21,220+0.47%
Russell2,187-0.64%
VIX18.20+0.7
10Y Yield4.31%+3.0bp
Gold2,936+0.62%
Crude70.40-0.98%
Bitcoin95,800-0.42%
S&P 5005,983+0.49%
NASDAQ21,220+0.47%
Russell2,187-0.64%
VIX18.20+0.7
10Y Yield4.31%+3.0bp
Gold2,936+0.62%
Crude70.40-0.98%
Bitcoin95,800-0.42%
simulated

VaR / CVaR Methodology

Multi-asset risk engine: 3-day 99% Conditional Value at Risk with GFC stress augmentation.


Overview

PrimeRisk computes Conditional Value at Risk (CVaR), also known as Expected Shortfall (ES), for portfolios spanning four asset classes:

CVaR answers the question: "Given that we are in the worst 1% of outcomes, what is the average loss?" This is more conservative than VaR alone, which only identifies the threshold.

Default Parameters

ParameterValueRationale
Holding period3 trading daysFICC GSD standard liquidation horizon
Confidence level99%Regulatory standard (Basel III, FRTB)
Lookback window10 years (~2,520 trading days)Captures multiple market regimes
GFC stub18 months (Jan 2008 – Jun 2009)Ensures GFC stress is always in sample
Stub stress multiplier2.0x volatilityEmpirical GFC vol was 2-3x normal
Scaling methodsqrt(T) parametricStandard for short holding periods

Methodology by Asset Class

Equities

Risk factor: Individual stock return volatility.

dailyVol = annualVol / sqrt(252)
3-day VaR = |MV| × dailyVol × sqrt(3) × z_0.99

Where z_0.99 = 2.326 (99th percentile of standard normal).

InputSourceDefault
Annual volatilityUser-supplied or implied vol from market data25%
Correlation (intra-class)Between different stocks0.50

US Treasuries

Risk factor: Yield volatility by maturity bucket, translated to dollar P&L via DV01.

dailyYieldVol = bucketYieldVol / sqrt(252)    [in basis points]
dailyDollarVol = DV01 × dailyYieldVol
dailyReturnVol = dailyDollarVol / |MV|
3-day VaR = |MV| × dailyReturnVol × sqrt(3) × z_0.99

Yield Volatility by Maturity Bucket (annualized, basis points):

BucketYield Vol (bps/yr)Rationale
< 1 year45Short-end anchored by Fed policy
1-3 years70Sensitive to rate expectations
3-5 years75Peak sensitivity zone
5-7 years72Moderate duration
7-10 years68Benchmark sector
10-20 years65Long-end mean reversion
20-30 years62Ultra-long convexity dampens vol

DV01 (Dollar Value of a Basis Point):

DV01 = MV × ModifiedDuration × 0.0001

If modified duration is not supplied, it is approximated from years to maturity and coupon using a semi-annual compounding model with a 4.25% yield proxy.

InputSourceDefault
Modified durationUser-supplied or approximated0.9 × years to maturity
DV01User-supplied or computedMV × modDur × 0.0001
Correlation (intra-class)Between Treasury buckets0.85

Corporate Bonds

Risk factor: Combined rate risk + credit spread risk.

totalYieldVol = sqrt(rateVol² + spreadVol²)

Rate risk uses the same Treasury yield volatility table. Spread risk uses a rating-dependent spread volatility.

Credit Spread Volatility by Rating (annualized, basis points):

RatingSpread Vol (bps/yr)Rationale
AAA15Minimal spread movement
AA20Very low credit risk
A30Investment grade
BBB50Lower IG, more spread sensitivity
BB90High yield threshold
B140Speculative grade
CCC250Distressed
NR (Not Rated)60Conservative IG-equivalent

The combined daily volatility is:

dailyTotalVol = sqrt(rateVol² + spreadVol²) / sqrt(252)
dailyDollarVol = DV01 × dailyTotalVol

This assumes low correlation between rate moves and spread moves — they can move independently (rates fall while spreads widen in a flight-to-quality scenario).

InputSourceDefault
Credit ratingUser-suppliedBBB
Spread durationUser-suppliedSame as modified duration
Modified durationUser-supplied or approximated0.85 × years to maturity
Correlation (intra-class)Between different corp bonds0.65

Convertible Bonds

Risk factor: Hybrid equity delta + credit spread risk with negative correlation.

Convertible bonds have both equity sensitivity (through the embedded call option) and credit risk (as a corporate bond). These are combined using a negative correlation of -0.30, reflecting the empirical observation that equity rallies often coincide with spread tightening and vice versa.

equityComponent = delta × equityDailyVol
creditComponent = spreadDailyVol × modDur × 0.0001
combinedVol = sqrt(equity² + credit² + 2 × (-0.30) × equity × credit)
InputSourceDefault
Equity deltaUser-supplied0.50 (at-the-money)
Underlying tickerUser-suppliedSame as bond ticker
Equity volUser-supplied25%
Credit ratingUser-suppliedBB
Equity-credit correlationFixed-0.30
Correlation (intra-class)Between converts0.45

VaR Computation

Two methods are computed for each position; the conservative (higher) value is used.

Parametric VaR

Assumes normally distributed returns.

VaR_99 = |MV| × dailyVol × sqrt(holdingPeriod) × z_0.99
CVaR_99 = |MV| × dailyVol × sqrt(holdingPeriod) × phi(z_0.99) / (1 - 0.99)

Where:

For a $10M position with 25% annual equity vol:

Monte Carlo VaR

Generates synthetic P&L distributions with a seeded PRNG for reproducibility.

  1. Generate ~2,520 normal-period daily returns using position-specific daily vol
  2. Generate ~378 GFC-stub returns at 2x the daily vol (stress period)
  3. Scale daily returns to 3-day returns via sqrt(3)
  4. Sort the combined sample (2,898 observations)
  5. VaR_99 = loss at the 1st percentile
  6. CVaR_99 = average of all losses beyond VaR_99 (~29 observations)

The stub ensures the GFC is always represented in the tail, even though it may be outside the 10-year lookback window.


Portfolio VaR with Diversification

Position-level VaRs are aggregated using a correlation-adjusted approach:

Portfolio_VaR² = Σ_i Σ_j sign_i × sign_j × VaR_i × VaR_j × ρ_ij
Portfolio_VaR = sqrt(Portfolio_VaR²)

Where sign accounts for long (+1) vs. short (-1) positions, and ρ_ij is the estimated correlation between positions.

Cross-Asset Correlation Matrix

EquityTreasuryCorporateConvertible
Equity0.50-0.200.400.60
Treasury-0.200.850.30-0.05
Corporate0.400.300.650.55
Convertible0.60-0.050.550.45

Key relationships:

Diversification Benefit

Diversification = 1 - (Portfolio_VaR / Undiversified_VaR)

Where Undiversified_VaR is the simple sum of all position VaRs. A portfolio with long equities and long Treasuries will show meaningful diversification due to the negative equity-Treasury correlation.


GFC Stub Period

The 18-month stress window (January 2008 – June 2009) captures the most severe fixed income and credit market dislocations in modern history:

EventDateImpact
Bear Stearns collapseMar 2008Repo market freeze
Lehman Brothers bankruptcySep 2008Credit markets seize
AIG bailoutSep 2008Counterparty risk repricing
TARP enactedOct 2008Government intervention
Treasury yields hit 2%Dec 2008Flight-to-quality extreme
Credit spreads peakDec 2008IG spreads > 600 bps, HY > 2,000 bps
Equity market bottomMar 2009S&P 500 at 676
Recovery beginsQ2 2009Spreads normalize, rates stabilize

The stub is applied at 2x normal volatility, which is conservative relative to actual GFC vol (2-3x in equities, 3-5x in credit spreads, 1.5-2x in Treasuries).

By always including this period, the VaR estimate never "forgets" the GFC even as the 10-year rolling window moves forward.


Comparison: CVaR vs. Haircut Margin

The FICC margin calculator shows both:

MetricMethodUse Case
Haircut MarginMV × maturity-based haircut rateFICC GSD clearing fund methodology
3-Day 99% CVaRDV01-based VaR with GFC stressIndependent risk validation

If CVaR exceeds the haircut margin, it suggests the published haircut schedule may understate risk for that portfolio (e.g., concentrated duration exposure or high-vol maturity buckets).


Implementation

import { computeVaR } from '@/lib/var'

const report = computeVaR([
  {
    id: 'pos-1',
    ticker: 'AAPL',
    assetClass: 'equity',
    side: 'long',
    marketValue: 10_000_000,
    vol: 0.28,
  },
  {
    id: 'pos-2',
    ticker: '912810TV0',
    assetClass: 'treasury',
    side: 'long',
    marketValue: 50_000_000,
    modifiedDuration: 18.5,
    yearsToMaturity: 28,
  },
  {
    id: 'pos-3',
    ticker: 'XYZ-CONVERT',
    assetClass: 'convertible',
    side: 'long',
    marketValue: 5_000_000,
    equityDelta: 0.65,
    rating: 'BB',
    underlyingTicker: 'XYZ',
  },
])

console.log(report.portfolioCvar99)    // 3-day 99% CVaR
console.log(report.diversificationPct) // diversification benefit %

Module Structure

FilePurpose
src/lib/var/types.tsType definitions, proxy vol tables, default config
src/lib/var/engine.tsCore VaR/CVaR computation, Monte Carlo, correlation
src/lib/var/index.tsPublic API exports

Limitations

  1. Parametric vol proxies: Volatility estimates use built-in lookup tables, not live market data. For production use, feed actual implied vols and historical yield series.

  2. Normal distribution assumption: Parametric VaR assumes normality. The Monte Carlo component with GFC stub partially addresses fat tails, but extreme events can still exceed CVaR.

  3. Static correlations: Cross-asset correlations are fixed constants. In practice, correlations spike during crises (correlation breakdown). The GFC stub partially compensates.

  4. No term structure modeling: Treasury VaR uses parallel yield shifts per bucket, not a full term structure model (e.g., Nelson-Siegel or PCA-based).

  5. No jump-to-default: Corporate bond VaR captures spread widening but not sudden default events. For distressed credits (CCC and below), a separate jump-to-default model would be more appropriate.

  6. Convertible simplification: The convert model uses a fixed delta and linear equity sensitivity. A full convertible model would incorporate gamma, vega, and credit-equity coupling dynamics.


Sources