analyzing-tail-risk

Evaluates portfolio tail risk with extreme value theory, expected shortfall, and tail hedge strategies. Use when analyzing tail risk, estimating expected shortfall, or evaluating tail protection.

11 stars

Best use case

analyzing-tail-risk is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Evaluates portfolio tail risk with extreme value theory, expected shortfall, and tail hedge strategies. Use when analyzing tail risk, estimating expected shortfall, or evaluating tail protection.

Teams using analyzing-tail-risk should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/analyzing-tail-risk/SKILL.md --create-dirs "https://raw.githubusercontent.com/CaseMark/skills/main/skills/finance/analyzing-tail-risk/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/analyzing-tail-risk/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How analyzing-tail-risk Compares

Feature / Agentanalyzing-tail-riskStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Evaluates portfolio tail risk with extreme value theory, expected shortfall, and tail hedge strategies. Use when analyzing tail risk, estimating expected shortfall, or evaluating tail protection.

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Analyzing Tail Risk

## When To Use

- Assessing portfolio exposure to extreme market events (crashes, liquidity crises, contagion)
- Estimating expected shortfall (CVaR) beyond standard VaR thresholds
- Evaluating whether existing tail hedges (puts, vol overlays, CTA allocations) provide adequate protection
- Stress-testing portfolio resilience under historical or hypothetical tail scenarios
- Comparing tail risk profiles across asset classes, strategies, or fund vintages

## Inputs To Gather

- **Return series**: Daily or weekly portfolio and benchmark returns (minimum 5 years; 10+ preferred for EVT fitting)
- **Confidence levels**: Target quantiles (typically 95%, 99%, 99.5%) and holding period
- **Portfolio composition**: Asset class weights, factor exposures, concentration metrics
- **Existing hedges**: Current tail protection instruments, notional sizes, strike levels, expiry dates
- **Regime context**: Current volatility regime (VIX level, MOVE index), credit spreads, correlation regime
- **Risk budget**: Maximum acceptable drawdown or expected shortfall threshold set by mandate or IPS
- **Historical stress events**: Specific scenarios to replay (e.g., GFC 2008, COVID March 2020, LTCM 1998) [VERIFY: confirm which events are relevant to the portfolio's asset universe]

## Workflow

1. **Prepare the return data**
   - Clean for stale prices, missing observations, and survivorship bias
   - Compute log returns; assess stationarity and serial correlation
   - Identify structural breaks that may invalidate a single-distribution assumption

2. **Estimate tail distribution parameters**
   - Fit a Generalized Pareto Distribution (GPD) to losses exceeding a high threshold (peaks-over-threshold method)
   - Estimate the tail index (shape parameter xi): xi > 0 indicates heavy tails; higher values mean fatter tails
   - Cross-validate threshold selection using mean excess plots and parameter stability plots
   - Compare parametric EVT estimates against historical simulation and filtered historical simulation

3. **Calculate tail risk metrics**
   - **VaR** at each target confidence level using both parametric EVT and empirical methods
   - **Expected Shortfall (CVaR)**: average loss conditional on exceeding VaR — report the gap between VaR and ES as a tail severity indicator
   - **Tail concentration ratio**: contribution of top N positions to portfolio-level ES
   - **Tail dependence**: estimate bivariate tail dependence coefficients between major holdings using copula methods (Clayton, Gumbel) to flag correlation breakdown risk

4. **Run stress and scenario analysis**
   - Replay historical tail events with current portfolio weights; report P&L impact
   - Construct hypothetical scenarios (e.g., +300bp rate shock with equity selloff and credit spread widening)
   - Reverse stress test: determine what market moves would breach the risk budget

5. **Evaluate tail hedge effectiveness**
   - Map each existing hedge to the risk factor it protects against
   - Compute hedge ratio and breakeven: what magnitude of drawdown is needed before the hedge pays off
   - Estimate bleed/carry cost as annualized drag on portfolio returns
   - Assess gap risk: scenarios where hedges underperform due to basis risk, counterparty risk, or liquidity mismatch
   - Benchmark tail hedge cost against alternatives (e.g., put spreads vs. outright puts vs. managed vol strategies vs. trend-following allocation)

6. **Synthesize and recommend**
   - Summarize whether tail risk exposure is within, approaching, or exceeding risk budget
   - Identify the largest unhedged tail exposures and their drivers
   - Propose adjustments: rebalancing, adding/removing hedges, or adjusting position sizing
   - Quantify the cost-benefit tradeoff of each recommendation

## Output

- **Executive summary**: Current tail risk posture in 3-5 sentences, including headline ES at the primary confidence level
- **Tail risk metrics table**: VaR, ES, tail index, and tail concentration at each confidence level
- **Stress scenario matrix**: P&L estimates across historical and hypothetical scenarios, with and without hedges
- **Hedge effectiveness scorecard**: Per-hedge cost, payoff profile, and gap risk assessment
- **Recommendations**: Ranked list of actions with estimated impact on ES and cost/drag

## Quality Checks

- Confirm GPD shape parameter is stable across reasonable threshold choices; flag if xi > 0.5 (extremely fat tails may indicate data issues or regime mixing)
- Verify ES estimates are consistent across methods (parametric EVT, historical, Monte Carlo) — divergence > 20% warrants investigation
- Ensure tail dependence estimates use sufficient joint extreme observations; small samples produce unreliable copula fits [VERIFY]
- Check that stress scenarios reflect the portfolio's actual factor exposures, not generic index-level shocks
- Validate that hedge payoff calculations account for actual contract terms (strike, expiry, margin requirements) rather than idealized assumptions [VERIFY: confirm current hedge positions and terms with portfolio records]
- Cross-reference tail risk budget thresholds against the governing IPS, fund mandate, or regulatory capital requirements [VERIFY: jurisdiction-specific capital rules — Basel III/IV, Solvency II, etc.]

Related Skills

managing-risk-management-healthcare

11
from CaseMark/skills

Structures healthcare risk management with incident investigation, claims analysis, and loss prevention strategies. Use when managing healthcare risk, investigating incidents, or developing loss prevention programs.

managing-risk-adjustment-coding

11
from CaseMark/skills

Captures HCC codes for risk adjustment with annual assessment and documentation requirements. Use when coding for risk adjustment, capturing HCC conditions, or managing RAF scores.

managing-high-risk-pregnancies

11
from CaseMark/skills

Guides management of preeclampsia, gestational diabetes, and other high-risk conditions with monitoring protocols. Use when managing high-risk pregnancies, monitoring preeclampsia, or managing GDM.

managing-cardiac-risk-preoperative

11
from CaseMark/skills

Applies ACC/AHA perioperative cardiac evaluation algorithm with functional capacity and risk indices. Use when performing cardiac preop evaluation, calculating RCRI, or assessing perioperative cardiac risk.

calculating-emergency-risk-scores

11
from CaseMark/skills

Computes validated risk scores (HEART, PERC, Wells, Ottawa, CURB-65) from clinical data. Use when calculating clinical decision scores, risk-stratifying ED patients, or applying clinical prediction rules.

assessing-suicide-risk

11
from CaseMark/skills

Applies Columbia Suicide Severity Rating Scale and structured risk assessment frameworks. Use when assessing suicide risk, documenting safety evaluations, or creating safety plans.

analyzing-vital-statistics

11
from CaseMark/skills

Structures vital records analysis with birth, death, and demographic trend reporting. Use when analyzing vital statistics, interpreting mortality data, or reporting demographic trends.

analyzing-social-determinants-of-health

11
from CaseMark/skills

Maps social determinants affecting health outcomes with intervention strategy development. Use when analyzing SDOH, mapping community resources, or designing social health interventions.

analyzing-pharmacovigilance-data

11
from CaseMark/skills

Structures post-marketing safety surveillance with signal detection and PSUR reporting. Use when analyzing safety signals, preparing PSURs, or managing pharmacovigilance data.

analyzing-flow-cytometry

11
from CaseMark/skills

Interprets flow cytometry panels for hematologic malignancy classification and minimal residual disease. Use when analyzing flow cytometry, classifying lymphomas/leukemias, or documenting immunophenotyping.

analyzing-epidemiological-data

11
from CaseMark/skills

Structures epidemiologic analysis with incidence, prevalence, rate calculations, and statistical inference. Use when calculating disease rates, analyzing epi data, or interpreting population statistics.

analyzing-clinical-trial-data

11
from CaseMark/skills

Structures clinical trial data analysis with primary endpoint evaluation and safety reporting. Use when analyzing trial results, evaluating endpoints, or preparing statistical reports.