value-at-risk-calculator
БесплатноБез исполняемых скриптовНе проверенValue at Risk (VaR) and related risk metrics calculation skill for financial and operational risk assessment
от a5c-ai★ 1 947 звёзд на GitHubОб этом скилле
Value at Risk Calculator
Overview
The Value at Risk Calculator skill provides comprehensive capabilities for calculating VaR and related risk metrics using multiple methodologies. It supports financial risk assessment, operational risk quantification, and regulatory compliance through parametric, historical, and simulation-based approaches.
Capabilities
- Historical simulation VaR
- Parametric VaR (variance-covariance)
- Monte Carlo VaR
- Conditional VaR (CVaR/Expected Shortfall)
- Incremental and component VaR
- Stress testing
- Backtesting and validation
- Regulatory reporting support
Used By Processes
- Monte Carlo Simulation for Decision Support
- Risk Assessment
- Decision Quality Assessment
Usage
Historical Simulation VaR
# Historical VaR configuration
historical_var_config = {
"method": "historical_simulation",
"data": {
"returns": portfolio_returns, # historical return series
"period": "daily",
"history_length": 252 # 1 year of trading days
},
"confidence_levels": [0.95, 0.99],
"holding_period": 1, # days
"options": {
"age_weighting": {
"enabled": True,
"decay_factor": 0.97
}
}
}
Parametric VaR
# Parametric (variance-covariance) VaR
parametric_var_config = {
"method": "parametric",
"portfolio": {
"positions": {
"Asset_A": {"value": 1000000, "weight": 0.4},
"Asset_B": {"value": 750000, "weight": 0.3},
"Asset_C": {"value": 750000, "weight": 0.3}
}
},
"parameters": {
"volatilities": {"Asset_A": 0.20, "Asset_B": 0.15, "Asset_C": 0.25},
"correlation_matrix": [
[1.0, 0.3, 0.2],
[0.3, 1.0, 0.5],
[0.2, 0.5, 1.0]
]
},
"confidence_level": 0.99,
"holding_period": 10 # days
}
Monte Carlo VaR
# Monte Carlo VaR configuration
monte_carlo_var_config = {
"method": "monte_carlo",
"simulations": 100000,
"model": {
"type": "geometric_brownian_motion",
"parameters": {
"drift": "historical",
"volatility": "garch"
}
},
"portfolio_valuation": "full_revaluation",
"confidence_levels": [0.95, 0.99],
"holding_period": 10
}
Conditional VaR (Expected Shortfall)
CVaR represents the expected loss given that VaR is exceeded:
- CVaR at 95% = Average loss in worst 5% of scenarios
- Required by Basel III/IV for market risk capital
- More coherent risk measure than VaR
Stress Testing
# Stress test scenarios
stress_tests = {
"scenarios": [
{
"name": "2008 Financial Crisis",
"shocks": {"equity": -0.40, "credit_spreads": 0.03, "rates": -0.02}
},
{
"name": "COVID-19 March 2020",
"shocks": {"equity": -0.30, "volatility": 0.50, "credit_spreads": 0.02}
},
{
"name": "Interest Rate Spike",
"shocks": {"rates": 0.03, "equity": -0.15}
}
],
"output": ["portfolio_loss", "position_contributions"]
}
Input Schema
{
"method": "historical|parametric|monte_carlo",
"portfolio": {
"positions": "object",
"total_value": "number"
},
"data": {
"returns": "array or path",
"period": "string"
},
"parameters": {
"confidence_levels": ["number"],
"holding_period": "number",
"volatility_model": "string"
},
"stress_testing": {
"scenarios": ["object"]
},
"backtesting": {
"enabled": "boolean",
"test_period": "string"
}
}
Output Schema
{
"var_results": {
"confidence_level": {
"VaR": "number",
"VaR_percent": "number",
"CVaR": "number",
"CVaR_percent": "number"
}
},
"component_var": {
"position": {
"marginal_var": "number",
"component_var": "number",
"contribution_percent": "number"
}
},
"stress_test_results": {
"scenario_name": {
"portfolio_loss": "number",
"loss_percent": "number"
}
},
"backtesting": {
"exceptions": "number",
"exception_rate": "number",
"traffic_light": "green|yellow|red",
"kupiec_test": "object",
"christoffersen_test": "object"
},
"risk_attribution": "object"
}
Best Practices
- Use multiple methods and compare results
- Validate with backtesting regularly
- Include fat tails (t-distribution or historical for parametric)
- Update parameters (volatility, correlations) frequently
- Complement VaR with stress testing
- Report CVaR alongside VaR for tail risk
- Document all assumptions and limitations
VaR Interpretation
| Metric | Meaning |
|---|---|
| VaR 95% = $1M | 95% confident loss won't exceed $1M |
| CVaR 95% = $1.5M | If loss exceeds VaR, average loss is $1.5M |
| Incremental VaR | Change in portfolio VaR from adding position |
| Component VaR | Position's contribution to tot |
Установить value-at-risk-calculator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteGlobGrepBashFAQ
Что делает скилл value-at-risk-calculator?
Value at Risk (VaR) and related risk metrics calculation skill for financial and operational risk assessment
Как установить скилл value-at-risk-calculator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл value-at-risk-calculator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
gtm-enterprise-account-planning
Strategic account planning and execution for enterprise deals. Use when planning complex sales cycles, managing multiple stakeholders, applying MEDDICC…
от GitHubgtm-partnership-architecture
Build and scale partner ecosystems that drive revenue and platform adoption. Use when building partner programs from scratch, tiering partnerships, managing…
от GitHublanding-page-conversion-audit
Audit a landing page, sales page or checkout page for conversion leaks and return a fix list ordered by expected revenue impact. Use when asked to review…
от GitHubpower-platform-architect
Use this skill when the user needs to transform business requirements, use case descriptions, or meeting transcripts into a technical Power Platform solution…
от GitHub