VaR and CVaR
workflow.run_var_cvarParametric Value at Risk (VaR) and Conditional VaR / Expected Shortfall (CVaR), the variance-covariance method (assumes normally distributed returns), plus Modified VaR (Cornish-Fisher skew/kurtosis correction, Boudt/Peterson/Croux) when a return series is supplied. Supply either a return series or a mean/stdev pair directly, at a confidence level. Output is at the same periodicity as the input (no automatic annualization) - a daily return series gives a daily VaR/CVaR. Use when user asks "what's my VaR at 95%/99%?", "what's my expected shortfall on this position?", or "does my Sharpe/VaR estimate need a fat-tails correction?". Returns: var, cvar (both positive loss magnitudes; cvar >= var always), z, mean, stdev, skewness, excess_kurtosis (both null unless 3+ returns were supplied), var_modified (skew/kurtosis-adjusted VaR; null when skewness is, OR when this series' skew/kurtosis are too extreme for the Cornish-Fisher expansion to be a valid quantile - skewness/excess_kurtosis are still returned in that case).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mean | No | Mean return, if not supplying returns[] directly | |
| stdev | No | Standard deviation of returns, if not supplying returns[] directly | |
| returns | No | Return series (e.g. daily % returns as decimals). Provide this OR mean+stdev, not both. | |
| confidence | No | Confidence level, 0-1 exclusive (default 0.95) |