---
title: Risk Metrics Calculation
category: product
entity_type: skill
price: $15
canonical: https://forgehouse.ai/skills/risk-metrics-calculation/
lang: en
hreflang_alt: https://forgehouse.ai/tr/skiller/risk-metrics-calculation/
last_updated: 2026-06-20
---

# Risk Metrics Calculation

> Calculate portfolio risk metrics including VaR, CVaR, Sharpe, Sortino, and drawdown analysis.

A complete portfolio risk toolkit that measures tail risk, volatility, drawdown, and risk-adjusted return with the right distribution assumptions instead of naive shortcuts. It computes VaR, CVaR, Sharpe, Sortino, Calmar, max drawdown, and more, then pressure-tests them with stress scenarios and rolling windows. Built to avoid the classic traps: trusting VaR alone, assuming normal returns, and ignoring how correlations spike in a crisis.

## Use cases
- Calculating portfolio VaR and CVaR for position sizing and risk limits
- Evaluating risk-adjusted return (Sharpe, Sortino, Calmar) after a backtest
- Monitoring drawdown and building a capital-preservation strategy
- Producing regulatory metrics like 99% VaR over a defined holding period
- Stress testing against historical crises and hypothetical shock scenarios
- Tracking rolling volatility, Sharpe, and beta to detect regime changes

## Benefits
- Avoids tail-risk underestimation by pairing VaR with CVaR and fat-tail methods
- Surfaces hidden danger that normal-distribution models miss in stress periods
- Reports honest ranges and confidence intervals instead of false precision
- Catches regime shifts early so risk limits adjust before losses compound

## What’s included
- Core RiskMetrics class: volatility, VaR (historical/parametric/Cornish-Fisher), CVaR, drawdown
- Portfolio-level risk: marginal contribution, risk parity, stress correlation
- Rolling-window metrics for volatility, Sharpe, VaR, beta, and regime classification
- Stress tester with historical crisis periods and Monte Carlo simulation
- A validation checklist covering lookback, distribution fit, and VaR backtesting
- Gotchas table for historical vs. parametric vs. Monte Carlo VaR trade-offs

## Who it’s for
Quant developers and portfolio teams who need rigorous, multi-metric risk measurement that respects fat tails, regimes, and regulatory reporting.

## How it runs
Market returns have fat tails, and a normal-distribution VaR will lie about them. The distribution gets tested first, then the full metric battery runs, stress tests included, and the model itself is backtested.
1. Validates the return series before computing anything: no gaps, corporate actions adjusted, log versus simple returns consistent, and a lookback of at least one year of daily observations, preferably three, with a regime-change check so a calm-period sample is not mistaken for normal.
2. Tests the distribution assumption explicitly: skewness and kurtosis are measured and normality is tested, and if the tails are fat (they almost always are) the normal-distribution VaR is replaced with historical quantiles, Cornish-Fisher expansion or a t-distribution.
3. Computes the full metric battery in one pass: volatility and downside deviation, VaR at 95 and 99 percent by three methods (historical, parametric, Cornish-Fisher), CVaR for the average loss beyond VaR, drawdown depth and duration, and risk-adjusted ratios (Sharpe, Sortino, Calmar, Omega).
4. Moves to portfolio level: marginal and component risk contribution per asset, diversification ratio, and the stress-conditional correlation matrix, because correlations that read 0.3 in calm markets jump toward 0.8 exactly when diversification is needed most.
5. Stress tests against named historical windows (2008 crisis, 2020 crash, 2022 rate hikes) and a Monte Carlo run with elevated volatility, reporting expected loss, tail VaR and the probability of a 10 percent loss over the horizon.
6. Backtests the VaR model (Kupiec exception count) and reports results as ranges with confidence intervals rather than seven-digit point estimates, because false precision is treated as a reporting defect.

## FAQ
### My portfolio isn't equities, does this work for crypto or mixed assets?
The core RiskMetrics class operates on return series, so any asset you can express as returns fits: crypto, multi-asset portfolios, strategy backtests. The portfolio layer adds marginal contribution, risk parity, and stress correlation on top.

### Plenty of libraries compute Sharpe, what's actually different here?
The distribution discipline. VaR is never left alone: it is paired with CVaR and Cornish-Fisher adjustments for fat tails, regime shifts are tracked through rolling windows, and the validation checklist covers VaR backtesting. Correlation spikes during crises are modeled explicitly rather than assumed normal.

### Will it tell me what to buy or predict returns?
No. It measures risk on positions you already hold or have backtested, there are no alpha signals or forecasts. Outputs are honest ranges and confidence intervals, deliberately not trade recommendations.

## Price
$15, one-time, no subscription. VAT included.

Related guide: [AI for small business](https://forgehouse.ai/guides/ai-for-small-business/)
