Repository navigation
v2.0.0
Release Notes – v2.0.0
🚀 First Major Release: v2.0.0
We are excited to announce the first major release of VaRpy, a Python library for Value at Risk (VaR) and Conditional Value at Risk (CVaR) modeling using advanced statistical distributions and GARCH models.
What's New
-
Major Refactoring and Modernization
- Complete overhaul of the codebase for improved organization, maintainability, and consistency.
- All VaR models now use a unified, class-based architecture with a shared
BaseVarinterface. - Modular design with private helper methods for key computations and clear separation of concerns.
-
Standardized Model Structure
- Each model (Normal, Student's t, EVT) follows a consistent interface:
- Constructor only requires
theta(confidence level) andhorizon(forecast period). .run()method processes return data and computes VaR/CVaR.- Consistent naming and comprehensive docstrings across all classes and methods.
- Constructor only requires
- Each model (Normal, Student's t, EVT) follows a consistent interface:
-
Improved Type Hints and Documentation
- Extensive use of modern Python type hints (
numpy.typing) for clarity and static analysis. - All methods and classes are fully documented with clear parameter and return type information.
- Extensive use of modern Python type hints (
-
Enhanced Code Organization
- Models are now located in
varpy/var/models/with consistent, lower-case file naming. - Project configuration and dependencies are managed via
pyproject.toml(PEP 621), with legacy files (setup.py,setup.cfg,requirements.txt) removed for simplicity.
- Models are now located in
-
Flexible and Extensible Design
- Adding new VaR models is straightforward: inherit from
BaseVar, implementrun(), and follow the established modular pattern. - Comprehensive contributing guidelines provided in the README.
- Adding new VaR models is straightforward: inherit from
Available Models
| Model | Description |
|---|---|
| Normal | Assumes returns are normally distributed; GARCH(1,1) with Gaussian innovations |
| Student's t | Heavy-tailed returns; GARCH(1,1) with Student's t innovations |
| EVT | Extreme Value Theory; combines GARCH with Generalized Pareto Distribution for tail modeling |