Skip to content

Conversation

@adrianhasse
Copy link
Contributor

No description provided.

@adrianhasse adrianhasse linked an issue Jul 18, 2025 that may be closed by this pull request
5 tasks
@adrianhasse adrianhasse requested a review from Copilot July 18, 2025 09:59

This comment was marked as outdated.

adrianhasse and others added 2 commits July 18, 2025 12:01
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adrianhasse adrianhasse requested a review from Copilot July 18, 2025 10:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds linear regression analysis of log-equity curves to compute statistical metrics for portfolio performance evaluation. The changes include calculating slope, standard error, t-statistic, and R² values for both portfolio and benchmark equity curves.

Key changes:

  • Adds new _equity_curve_stats method to perform linear regression on log-equity curves
  • Updates benchmark metric naming for consistency (total_benchmark_return → benchmark_total_return)
  • Adds scipy dependency for statistical calculations

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
kissbt/analyzer.py Implements the new _equity_curve_stats method and integrates it into performance metrics calculation
pyproject.toml Adds scipy dependency for statistical calculations
tests/test_analyzer.py Adds comprehensive tests for the new linear regression statistics functionality
tests/test_integration.py Updates test assertions to use the new benchmark metric naming
Comments suppressed due to low confidence (2)

kissbt/analyzer.py:100

  • [nitpick] The error message is clear but could be more specific about which series contains the non-positive values. Consider adding context like 'Portfolio value series contains...' or 'Benchmark value series contains...' to help with debugging.
            raise ValueError(

tests/test_analyzer.py:36

  • [nitpick] The magic number calculation 256 * 3 is unclear. Consider using a more descriptive variable name or comment to explain why 768 days (approximately 3 trading years) is used.
    num_days = 256 * 3

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@adrianhasse adrianhasse merged commit 4c93023 into main Jul 18, 2025
4 checks passed
@adrianhasse adrianhasse deleted the feature/add-regression-based-performance-stats-to-analyzer branch July 18, 2025 11:49
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 regression‑based performance stats to Analyzer

2 participants