You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Add benchmark-relative portfolio statistics
* Strengthen benchmark-statistic tests
Replace degenerate-input unit tests with discriminating ones for the
five benchmark-relative statistics so they fail under subtle formula
errors:
- InformationRatio/TrackingError: known-value tests with a non-zero
benchmark so the active = r - b subtraction is exercised.
- TreynorRatio: a case with period != n and rf != 0 to catch a wrong
annualization exponent and a missing rf annualization.
- Alpha: a non-zero-mean benchmark with a small period to exercise the
beta * (mean_b - rf) term and the geometric annualization.
- InformationRatio: partial-overlap inner-join and intraday->daily
compounding cases covering align_returns end-to-end.
- Non-default-period name() tests.
Also align BetaRatio.__repr__ with the other wrappers via to_string().
* Wire benchmark statistics into analyzer and tearsheet
Expose the five benchmark-relative statistics (Beta, Alpha, Information
Ratio, Tracking Error, Treynor) through the PortfolioAnalyzer and the
tearsheet so they are computed and displayed when a benchmark is given:
- analyzer.rs: add a stateless `get_performance_stats_returns_vs_benchmark`
that iterates registered statistics and calls
`calculate_from_returns_with_benchmark` against the primary returns and
the caller-supplied benchmark, collecting only `Some` values. No
benchmark field is stored; `Default`, `reset`, and `calculate_statistics`
are untouched.
- python/analyzer.rs: register/deregister the five new class names and add
the PyO3 getter `get_performance_stats_returns_vs_benchmark`, transforming
the benchmark map into the returns type before delegating to Rust.
- analyzer.py: add a thin delegating getter that dispatches to the
registered PyO3 benchmark statistics (non-benchmark stats lack the method
and are skipped); no parallel Python math.
- tearsheet.py: when a benchmark series is present, merge the benchmark
stats into the returns statistics shown, consistent with `stats_returns`.
- analysis/__init__.py: export the five new classes.
- nautilus_pyo3.pyi: add the five classes and the new getter to the stub.
* Compute benchmark stats from resolved tearsheet returns
* Share active-return stats between IR and tracking error
* Refine benchmark-statistic docs and add analyzer tests
Polish the benchmark-statistic stack ahead of review:
- Complete the Sharpe (1964) citation and unify doc terminology on
"portfolio" across the five new statistics.
- Correct the trait doc for the None default and add a genuine
zero-beta Treynor test alongside the renamed flat-benchmark case.
- Rename the unused PyO3 stub parameter to _returns, alphabetize the
register/deregister match arms and .pyi class blocks.
- Guard the Python benchmark getter to pyo3 statistics only and build
the dict conversions lazily; note the pd.Timestamp index requirement.
- Document benchmark-relative statistics in the tearsheet docstring.
- Add analyzer-level benchmark tests in Rust and Python.
0 commit comments