skillfed

risk-analysis

Risk-analysis provides quantitative methods for measuring portfolio risk through Value at Risk, Conditional Value at Risk, maximum drawdown analysis, and Monte Carlo simulation. It includes historical and parametric VaR calculation, tail-risk analysis via extreme value theory, and stress-testing frameworks using both historical scenarios and hypothetical shock models.

Risk-analysis calculates VaR, CVaR, and maximum drawdown to assess portfolio risk exposure.

AI-generated summary based on this skill's SKILL.md

28,096 4,557 MIT updated by HKUDS

Install

HKUDS/Vibe-Trading/risk-analysis · repository language: Python

CLI (skillfed)coming soon
git clone https://github.com/HKUDS/Vibe-Trading
cp -r Vibe-Trading/agent/src/skills/risk-analysis ~/.claude/skills/risk-analysis

Frequently asked questions

AI-generated answers based on this skill's SKILL.md and metadata

How does risk-analysis calculate VaR and CVaR for portfolio risk?

Risk-analysis computes Value at Risk and Conditional Value at Risk (expected shortfall) using both historical and parametric methods. VaR measures the maximum loss at a given confidence level, while CVaR captures the expected loss beyond that threshold. The skill supports multiple calculation approaches to suit different portfolio structures and risk profiles.

What monte carlo simulation capabilities does risk-analysis offer?

Risk-analysis runs Monte Carlo simulations to model tail risk and extreme scenarios across your portfolio. By generating thousands of potential price paths, it reveals how your holdings behave under stress conditions and helps identify tail-risk exposures that traditional metrics might miss.

Can risk-analysis stress test my portfolio against historical crises?

Yes. Risk-analysis includes stress-testing frameworks that replay historical market shocks—such as the 2008 crisis—against your current portfolio. It also supports hypothetical scenario analysis, letting you model custom shocks to interest rates, volatility, or asset correlations to assess resilience.

How does risk-analysis analyze tail behavior and extreme value theory?

Risk-analysis applies extreme value theory and Generalized Pareto Distribution (GPD) fitting to analyze tail behavior. This approach captures fat-tail risk and rare events more accurately than normal-distribution assumptions, helping you understand the true probability and magnitude of extreme losses.

What risk-control recommendations does risk-analysis generate?

Risk-analysis generates actionable risk-control recommendations based on drawdown analysis, volatility metrics, and stress-test results. These suggestions help you rebalance, hedge, or adjust position sizes to align your portfolio with your risk tolerance and performance objectives.

Does risk-analysis support maximum drawdown and recovery analysis?

Risk-analysis measures maximum drawdown to quantify the largest peak-to-trough decline in your equity curve. It also analyzes recovery patterns, helping you understand how long portfolios typically take to bounce back from losses and informing your risk-management strategy.

SKILL.md

rendered from the published skill — quoted content, verbatim

Risk Measurement and Stress Testing

Overview

Systematic risk-measurement methodology covering VaR/CVaR calculation, Monte Carlo simulation, stress-test design, and tail-risk analysis. It provides risk evaluation for backtest results and risk-control constraints for asset allocation.

Risk Measurement Methods

1. VaR (Value at Risk)

Definition: the maximum expected loss over a given horizon at a specified confidence level.

Three Calculation Methods
Method Formula / Steps Advantages Disadvantages
Historical simulation Sort historical returns and take the quantile No distribution assumption Depends on historical samples
Parametric (normal) VaR = μ - z_α × σ Easy to compute Assumes a normal distribution
Monte Carlo Simulate N paths and take the quantile Flexible Computationally intensive
Historical Simulation Implementation

```python import numpy as

(truncated - see the full file via the links below)

Read as markdown · JSON record · Browse the source repository

File tree — 1 file
agent/src/skills/risk-analysis/SKILL.md

Related skills

Tags

quantitative-risk tail-risk-modeling monte-carlo-methods drawdown-analysis stress-scenario-testing extreme-value-theory portfolio-risk-metrics risk-decomposition market-shock-analysis risk-budgeting