forward-risk
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseForward-Looking Risk Analysis
前瞻性风险分析
Purpose
用途
Estimate potential future losses and risk exposures using parametric models, simulation, and scenario analysis. This skill covers parametric and Monte Carlo Value-at-Risk, Conditional VaR (Expected Shortfall), component and marginal VaR, stress testing, scenario analysis, and factor-based risk decomposition. These tools are essential for portfolio risk management and regulatory capital calculations.
使用参数模型、模拟和情景分析估算潜在未来损失和风险敞口。本技能涵盖参数法和蒙特卡洛风险价值、条件风险价值(CVaR/期望损失)、成分与边际VaR、压力测试、情景分析以及基于因子的风险分解。这些工具是投资组合风险管理和监管资本计算的核心工具。
Layer
层级
1b — Forward-Looking Risk
1b — 前瞻性风险
Direction
方向
Prospective
预测类
When to Use
适用场景
- Estimating potential future losses for a portfolio or position
- Computing parametric VaR (variance-covariance method) for normally distributed returns
- Running Monte Carlo simulations to estimate VaR for non-normal distributions
- Computing CVaR / Expected Shortfall to understand tail risk beyond VaR
- Decomposing portfolio risk into component and marginal contributions
- Performing scenario analysis with historical or hypothetical shocks
- Stress testing portfolios under extreme but plausible conditions
- Breaking down risk into systematic factor risk and idiosyncratic risk
- 估算投资组合或持仓的潜在未来损失
- 为正态分布的收益计算参数法VaR(方差-协方差法)
- 运行蒙特卡洛模拟为非正态分布估算VaR
- 计算CVaR/期望损失,以了解VaR之外的尾部风险
- 将投资组合风险分解为成分贡献和边际贡献
- 使用历史或假设冲击执行情景分析
- 在极端但合理的条件下对投资组合进行压力测试
- 将风险拆解为系统性因子风险和异质性风险
Core Concepts
核心概念
Parametric (Variance-Covariance) VaR
参数法(方差-协方差)VaR
Assumes returns are normally distributed. For a single asset or portfolio in dollar terms (assuming zero expected return over short horizons):
VaR = W * z_alpha * sigma_pwhere:
- W = portfolio value
- z_alpha = z-score for confidence level (1.645 for 95%, 2.326 for 99%)
- sigma_p = portfolio volatility over the relevant horizon
More generally, including expected return:
VaR_alpha = mu - z_alpha * sigmaTo convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):
VaR_h = VaR_1 * sqrt(h)假设收益服从正态分布。对于以美元计价的单一资产或投资组合(假设短时间内预期收益为0):
VaR = W * z_alpha * sigma_p其中:
- W = 投资组合价值
- z_alpha = 对应置信水平的z值(95%置信度为1.645,99%置信度为2.326)
- sigma_p = 对应时间范围内的投资组合波动率
更通用的公式包含预期收益:
VaR_alpha = mu - z_alpha * sigma如需将1天期VaR转换为h天期VaR(假设收益独立同分布):
VaR_h = VaR_1 * sqrt(h)Portfolio VaR (Multiple Assets)
投资组合VaR(多资产)
For a portfolio with weight vector w and covariance matrix Sigma:
sigma_p = sqrt(w' * Sigma * w)
VaR_p = W * z_alpha * sqrt(w' * Sigma * w)The covariance matrix captures both individual volatilities and correlations between assets.
对于权重向量为w、协方差矩阵为Sigma的投资组合:
sigma_p = sqrt(w' * Sigma * w)
VaR_p = W * z_alpha * sqrt(w' * Sigma * w)协方差矩阵同时包含单个资产的波动率和资产间的相关性。
Monte Carlo VaR
蒙特卡洛VaR
Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.
Steps:
- Estimate the return distribution parameters (mean vector, covariance matrix, or use a copula model).
- Generate N random return scenarios (e.g., via Cholesky decomposition of the covariance matrix for multivariate normal).
- Compute portfolio return for each scenario.
- Sort results and identify the alpha-percentile loss.
Monte Carlo VaR can accommodate non-normal distributions, fat tails, path-dependent instruments, and nonlinear payoffs (e.g., options).
模拟大量投资组合收益场景(例如10000个以上),然后取模拟损失分布的alpha分位点作为结果。
步骤:
- 估算收益分布参数(均值向量、协方差矩阵,或使用copula模型)。
- 生成N个随机收益场景(例如通过多变量正态分布协方差矩阵的Cholesky分解生成)。
- 计算每个场景下的投资组合收益。
- 对结果排序,取alpha分位点对应的损失值。
蒙特卡洛VaR可适配非正态分布、肥尾、路径依赖工具和非线性收益(例如期权)。
Conditional VaR (CVaR) / Expected Shortfall
条件风险价值(CVaR)/期望损失
CVaR answers: "Given that losses exceed VaR, what is the expected loss?"
ES_alpha = E[Loss | Loss > VaR_alpha]For a normal distribution:
ES_alpha = mu + sigma * phi(z_alpha) / (1 - alpha)where phi is the standard normal PDF.
CVaR is a coherent risk measure (unlike VaR) because it satisfies subadditivity: CVaR(A+B) <= CVaR(A) + CVaR(B). This means diversification always reduces or maintains CVaR, which is not guaranteed for VaR.
CVaR回答的问题是:「当损失超过VaR时,预期损失是多少?」
ES_alpha = E[Loss | Loss > VaR_alpha]对于正态分布:
ES_alpha = mu + sigma * phi(z_alpha) / (1 - alpha)其中phi是标准正态分布的概率密度函数。
CVaR是一致性风险度量(和VaR不同),因为它满足次可加性:CVaR(A+B) <= CVaR(A) + CVaR(B)。这意味着分散投资总能降低或保持CVaR水平,而VaR不保证这一点。
Component VaR
成分VaR
Decomposes total portfolio VaR into contributions from each position. Component VaRs sum to total VaR.
CVaR_i = w_i * beta_i * VaR_pwhere beta_i = Cov(R_i, R_p) / Var(R_p) is the asset's beta to the portfolio.
Equivalently:
CVaR_i = w_i * (partial VaR / partial w_i)
sum(CVaR_i) = VaR_pThis decomposition identifies which positions are the largest contributors to portfolio risk.
将总投资组合VaR拆解为每个持仓的贡献,所有成分VaR的和等于总VaR。
CVaR_i = w_i * beta_i * VaR_p其中beta_i = Cov(R_i, R_p) / Var(R_p) 是资产相对于投资组合的beta值。
等价公式:
CVaR_i = w_i * (partial VaR / partial w_i)
sum(CVaR_i) = VaR_p这种分解可以识别哪些持仓是投资组合风险的最大贡献来源。
Marginal VaR
边际VaR
Measures the rate of change of portfolio VaR with respect to a small increase in a position's weight.
MVaR_i = partial(VaR_p) / partial(w_i) = z_alpha * (Sigma * w)_i / sigma_pMarginal VaR is used for position sizing: adding to a position with low marginal VaR reduces portfolio risk more efficiently.
衡量持仓权重小幅上升时,投资组合VaR的变化率。
MVaR_i = partial(VaR_p) / partial(w_i) = z_alpha * (Sigma * w)_i / sigma_p边际VaR用于持仓规模调整:加仓边际VaR更低的持仓可以更高效地降低投资组合风险。
Scenario Analysis
情景分析
Apply specific historical or hypothetical market moves to the current portfolio to estimate P&L impact.
- Historical scenarios: Replay actual market events (e.g., 2008 GFC, 2020 COVID crash, 2022 rate hiking cycle) with current holdings.
- Hypothetical scenarios: Construct custom shocks (e.g., "equities -20%, rates +200bp, credit spreads +300bp, USD +10%").
Scenario P&L is computed by applying the scenario returns to current position exposures and revaluing.
将特定的历史或假设市场变动应用到当前投资组合,估算对盈亏的影响。
- 历史情景: 用当前持仓复现真实市场事件(例如2008年全球金融危机、2020年新冠暴跌、2022年加息周期)。
- 假设情景: 构建自定义冲击(例如「股票下跌20%,利率上升200bp,信用利差上升300bp,美元升值10%」)。
情景盈亏的计算方式是将情景收益应用到当前持仓敞口并重新估值。
Stress Testing
压力测试
A structured framework for assessing portfolio resilience under extreme but plausible conditions.
Common stress scenarios:
- Equity crash: S&P 500 -30% to -40%
- Interest rate shock: +300bp parallel shift
- Credit crisis: investment-grade spreads +200bp, high-yield +800bp
- Liquidity freeze: bid-ask spreads widen 10x, forced selling at discount
- Currency shock: major currency pair moves 15-20%
- Stagflation: inflation +5%, GDP -3%, rates +200bp
Stress tests should include second-order effects: margin calls, liquidity demands, correlation spikes, counterparty risk.
评估投资组合在极端但合理条件下韧性的结构化框架。
常见压力情景:
- 股市暴跌:标普500下跌30%-40%
- 利率冲击:平行上行300bp
- 信用危机:投资级利差上升200bp,高收益利差上升800bp
- 流动性冻结:买卖价差扩大10倍,被迫折价抛售
- 汇率冲击:主流货币对波动15%-20%
- 滞胀:通胀上升5%,GDP下降3%,利率上升200bp
压力测试应包含二阶效应:追加保证金、流动性需求、相关性飙升、对手方风险。
Factor-Based Risk Decomposition
基于因子的风险分解
Separate total portfolio risk into systematic factor risk and idiosyncratic (security-specific) risk.
sigma^2_p = b' * Sigma_f * b + sum(w_i^2 * sigma^2_epsilon_i)where:
- b = vector of portfolio factor exposures
- Sigma_f = factor covariance matrix
- sigma^2_epsilon_i = idiosyncratic variance of asset i
Common factor models: Fama-French (market, size, value, momentum), Barra risk models, PCA-based statistical factors.
将总投资组合风险拆分为系统性因子风险和异质性(单证券特有)风险。
sigma^2_p = b' * Sigma_f * b + sum(w_i^2 * sigma^2_epsilon_i)其中:
- b = 投资组合因子敞口向量
- Sigma_f = 因子协方差矩阵
- sigma^2_epsilon_i = 资产i的异质性方差
常见因子模型:Fama-French(市场、规模、价值、动量)、Barra风险模型、基于PCA的统计因子。
Key Formulas
核心公式
| Formula | Expression | Use Case |
|---|---|---|
| Parametric VaR (single) | W * z_alpha * sigma | Simple position VaR |
| Portfolio VaR | W * z_alpha * sqrt(w' * Sigma * w) | Multi-asset VaR |
| Multi-day VaR | VaR_1 * sqrt(h) | Scale to h-day horizon |
| CVaR (normal) | mu + sigma * phi(z_alpha) / (1 - alpha) | Expected tail loss |
| Component VaR | w_i * beta_i * VaR_p | Risk contribution per position |
| Marginal VaR | z_alpha * (Sigma * w)_i / sigma_p | Sensitivity to weight change |
| Factor Risk | b' * Sigma_f * b | Systematic risk component |
| Idiosyncratic Risk | sum(w_i^2 * sigma^2_epsilon_i) | Security-specific risk |
| 公式 | 表达式 | 适用场景 |
|---|---|---|
| 参数法VaR(单资产) | W * z_alpha * sigma | 简单持仓VaR计算 |
| 投资组合VaR | W * z_alpha * sqrt(w' * Sigma * w) | 多资产VaR计算 |
| 多日VaR | VaR_1 * sqrt(h) | 换算为h天周期的VaR |
| CVaR(正态分布) | mu + sigma * phi(z_alpha) / (1 - alpha) | 预期尾部损失计算 |
| 成分VaR | w_i * beta_i * VaR_p | 单个持仓的风险贡献计算 |
| 边际VaR | z_alpha * (Sigma * w)_i / sigma_p | 权重变动的风险敏感性计算 |
| 因子风险 | b' * Sigma_f * b | 系统性风险成分计算 |
| 异质性风险 | sum(w_i^2 * sigma^2_epsilon_i) | 单证券特有风险计算 |
Worked Examples
示例
Example 1: Parametric 95% VaR
示例1:参数法95% VaR
Given: A $1,000,000 equity portfolio with an annualized volatility of 15%.
Calculate: 1-day 95% parametric VaR (assuming 252 trading days and zero expected daily return).
Solution:
Daily volatility:
sigma_daily = 0.15 / sqrt(252) = 0.15 / 15.875 = 0.009451-day 95% VaR:
VaR = $1,000,000 * 1.645 * 0.00945 = $15,545Alternatively, computing directly from annual figures:
VaR_annual = $1,000,000 * 1.645 * 0.15 = $246,750
VaR_1day = $246,750 / sqrt(252) = $15,545Interpretation: There is a 5% chance of losing more than $15,545 in a single day under normal market conditions.
已知条件: 100万美元的股票投资组合,年化波动率为15%。
计算目标: 1天期95%参数法VaR(假设每年252个交易日,日预期收益为0)。
解决方案:
日波动率:
sigma_daily = 0.15 / sqrt(252) = 0.15 / 15.875 = 0.009451天期95% VaR:
VaR = $1,000,000 * 1.645 * 0.00945 = $15,545也可以直接从年化数据计算:
VaR_annual = $1,000,000 * 1.645 * 0.15 = $246,750
VaR_1day = $246,750 / sqrt(252) = $15,545释义:正常市场条件下,单日损失超过15545美元的概率为5%。
Example 2: Monte Carlo VaR
示例2:蒙特卡洛VaR
Given: A two-asset portfolio (60% equities, 40% bonds). Equities: mu = 10%, sigma = 18%. Bonds: mu = 4%, sigma = 5%. Correlation rho = -0.2. Portfolio value = $1,000,000.
Calculate: 95% annual VaR via Monte Carlo simulation (conceptual steps).
Solution:
- Construct covariance matrix:
Sigma = | 0.0324 -0.0018 |
| -0.0018 0.0025 |-
Cholesky decomposition of Sigma to get lower triangular matrix L.
-
Simulate 10,000 scenarios: For each simulation, draw z ~ N(0, I), compute r = mu + L*z, then portfolio return R_p = w' * r.
-
Compute portfolio P&L for each scenario: P&L = $1,000,000 * R_p.
-
Sort P&L from worst to best. The 500th worst (5th percentile) is the 95% VaR.
For this portfolio, the analytical answer provides a benchmark:
sigma_p = sqrt(0.6^2 * 0.0324 + 0.4^2 * 0.0025 + 2 * 0.6 * 0.4 * (-0.0018))
= sqrt(0.01105)
= 10.51%
VaR_95% = $1,000,000 * 1.645 * 0.1051 = $172,890The Monte Carlo result should converge to approximately this value for a multivariate normal assumption.
已知条件: 两资产投资组合(60%股票,40%债券)。股票:mu=10%,sigma=18%。债券:mu=4%,sigma=5%。相关性rho=-0.2。投资组合价值=100万美元。
计算目标: 通过蒙特卡洛模拟计算95%年化VaR(概念步骤)。
解决方案:
- 构建协方差矩阵:
Sigma = | 0.0324 -0.0018 |
| -0.0018 0.0025 |-
对Sigma做Cholesky分解得到下三角矩阵L。
-
模拟10000个场景: 每次模拟生成z ~ N(0, I),计算r = mu + L*z,然后投资组合收益R_p = w' * r。
-
计算每个场景的投资组合盈亏: 盈亏 = $1,000,000 * R_p。
-
对盈亏从最差到最好排序,第500个最差结果(5%分位点)就是95% VaR。
该投资组合的解析解可作为基准:
sigma_p = sqrt(0.6^2 * 0.0324 + 0.4^2 * 0.0025 + 2 * 0.6 * 0.4 * (-0.0018))
= sqrt(0.01105)
= 10.51%
VaR_95% = $1,000,000 * 1.645 * 0.1051 = $172,890假设多变量正态分布的前提下,蒙特卡洛模拟结果会收敛到接近该值的水平。
Example 3: Expected Shortfall
示例3:期望损失
Given: From the Monte Carlo simulation above, the losses exceeding VaR (the worst 500 out of 10,000 scenarios) have an average loss of $225,000.
Calculate: 95% CVaR.
Solution:
CVaR_95% = $225,000Interpretation: When losses exceed the 95% VaR threshold, the average loss is $225,000. This is 30% worse than the VaR figure, highlighting the severity of tail events.
已知条件: 基于上述蒙特卡洛模拟,损失超过VaR的场景(10000个场景中最差的500个)的平均损失为225000美元。
计算目标: 95% CVaR。
解决方案:
CVaR_95% = $225,000释义:当损失超过95% VaR阈值时,平均损失为225000美元,比VaR数值高30%,体现了尾部事件的严重性。
Common Pitfalls
常见误区
- VaR says nothing about tail shape: VaR only identifies a threshold. Two portfolios with identical VaR can have vastly different tail losses. Always compute CVaR alongside VaR to understand tail severity.
- Parametric VaR assumes normality: Financial returns exhibit fat tails and skewness. Parametric VaR systematically underestimates tail risk. Use Monte Carlo with fat-tailed distributions or historical simulation for more realistic estimates.
- Correlation breakdown in crises: Correlations spike toward 1.0 during market stress, precisely when diversification is most needed. Stress tests should use crisis-period correlations, not calm-period correlations.
- Using too short a lookback for covariance estimation: Too short a window is noisy; too long a window includes stale data from different market regimes. A common compromise is 1-3 years of daily data, or use EWMA-weighted covariances.
- Not distinguishing between absolute VaR and relative VaR: Absolute VaR includes expected return (VaR = -mu + zsigma); relative VaR excludes it (VaR = zsigma). For short horizons (1-10 days), the expected return is negligible and the distinction is minor. For longer horizons, it matters.
- Square-root-of-time scaling limitations: VaR_h = VaR_1 * sqrt(h) assumes i.i.d. returns. With serial correlation or volatility clustering, this scaling is inaccurate.
- VaR不反映尾部形状: VaR仅标识阈值,两个VaR相同的投资组合可能尾部损失差异极大。计算VaR时务必同时计算CVaR以了解尾部严重程度。
- 参数法VaR假设正态分布:金融收益存在肥尾和偏度,参数法VaR会系统性低估尾部风险。建议使用肥尾分布的蒙特卡洛模拟或历史模拟得到更符合实际的估算结果。
- 危机期间相关性失效:市场压力下相关性会飙升至1.0,恰好是分散投资最需要发挥作用的时候。压力测试应使用危机时期的相关性,而非平稳时期的相关性。
- 协方差估计的回溯窗口过短:窗口太短噪声大,窗口太长包含不同市场环境的过时数据。常用的折中方案是使用1-3年的日度数据,或使用EWMA加权的协方差。
- 未区分绝对VaR和相对VaR:绝对VaR包含预期收益(VaR = -mu + zsigma);相对VaR不包含预期收益(VaR = zsigma)。短周期(1-10天)下预期收益可以忽略,二者差异很小,长周期下差异明显。
- 时间平方根缩放的局限性:VaR_h = VaR_1 * sqrt(h) 假设收益独立同分布,存在序列相关或波动率聚集时该缩放方式不准确。
Cross-References
交叉参考
- historical-risk (wealth-management plugin, Layer 1a): Historical VaR and realized volatility serve as non-parametric alternatives and calibration benchmarks for the forward-looking models in this skill.
- performance-metrics (wealth-management plugin, Layer 1a): VaR and CVaR can be used as risk denominators in modified risk-adjusted ratios (e.g., return/CVaR).
- volatility-modeling (wealth-management plugin, Layer 1b): EWMA and GARCH volatility forecasts provide the volatility inputs (sigma) for parametric and Monte Carlo VaR.
- historical-risk(财富管理插件,层级1a):历史VaR和实际波动率可作为非参数替代方案,也可为本技能中的前瞻性模型提供校准基准。
- performance-metrics(财富管理插件,层级1a):VaR和CVaR可作为修正后风险调整比率的风险分母(例如收益/CVaR)。
- volatility-modeling(财富管理插件,层级1b):EWMA和GARCH波动率预测可为参数法和蒙特卡洛VaR提供波动率输入(sigma)。
Reference Implementation
参考实现
See for computational helpers.
scripts/forward_risk.py计算工具可参考 。
scripts/forward_risk.py