Skip to content

Add historical and parametric VaR and expected shortfall - #321

Open
chenyuan99 wants to merge 3 commits into
avhz:mainfrom
chenyuan99:feat/var-expected-shortfall
Open

chenyuan99 wants to merge 3 commits into
avhz:mainfrom
chenyuan99:feat/var-expected-shortfall

Conversation

@chenyuan99

Copy link
Copy Markdown

Summary

Closes #320. Adds a focused RustQuant_math::var module with historical VaR (type-7 quantile), Gaussian parametric VaR, and historical tail-mean expected shortfall. This fills the risk calculation gap upstream of VaR backtesting (#317), without adding dependencies. The implementation reuses the existing Statistic trait and standard Gaussian distribution.

Validation

  • cargo test -p RustQuant_math --lib: 117 passed, 0 failed.
  • cargo test -p RustQuant_math --doc var: 11 passed, 0 failed.
  • Rustfmt and Clippy have not been verified locally because the Rustup component download failed.

This draft is intended to gather feedback on API placement, ownership of the returns vector, and the historical tail convention before review.

@chenyuan99
chenyuan99 marked this pull request as ready for review December 3, 2026 02:00

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Value-at-Risk (VaR) and Expected Shortfall (CVaR) computation to RustQuant_math

1 participant