
Forward Risk
If you need to estimate how much you could lose on a portfolio, this handles the standard risk toolkit: parametric VaR using variance-covariance, Monte Carlo simulation for non-normal distributions, Expected Shortfall for tail risk beyond VaR, and component/marginal VaR to see which positions contribute most to total risk. It also covers stress testing and scenario analysis with historical or hypothetical shocks. The formulas are straightforward and it walks through converting daily to multi-day horizons, decomposing risk into systematic factors versus idiosyncratic noise, and the difference between coherent measures like CVaR and plain VaR. Useful for regulatory capital calculations or just understanding your downside before things get ugly.
- skills.sh installs
- 733
- GitHub stars
- 224
- last updated
- Aug 21, 2026
Install
$ npx -y skills add joellewis/finance_skills --skill forward-risk --agent claude-codeInstalls into .claude/skills of the current project.
Files
Forward-Looking Risk Analysis
Core Concepts
Parametric (Variance-Covariance) 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_p
where:
- 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 * sigma
To convert from 1-day VaR to h-day VaR (assuming i.i.d. returns):
VaR_h = VaR_1 * sqrt(h)
Portfolio VaR (Multiple Assets)
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.
Monte Carlo VaR
Simulate a large number of portfolio return scenarios (e.g., 10,000+), then take the alpha-percentile of the simulated loss distribution.
Sponsors
Details
- Repository
- github.com/joellewis/finance_skills
- Categories
- Frontend Development, Testing & QA, Productivity & Planning, Finance & Trading
- First seen
- Jun 3, 2026
More from joellewis/finance_skills
All 84- Privacy Data Security731
- Performance Reporting729
- Equities727
- Tax Efficiency724
- Anti Money Laundering723
- Financial Planning Integration723
- Advertising Compliance722
- Fixed Income Corporate722
- Portfolio Management Systems721
- Real Assets721
- Digital Assets719
- Fixed Income Sovereign718
- Know Your Customer715
- Tax Loss Harvesting715
- Investment Suitability714
- Next Best Action712
- Qualitative Valuation709
- Reconciliation707
- Regulatory Reporting707
- Exchange Connectivity706
- Operational Risk706
- Settlement Clearing706
- Performance Attribution705
- Alternatives703