Skip to content

Conversation

@wjb75
Copy link

@wjb75 wjb75 commented Aug 16, 2025

Pull Request

Pull Request Checklist

  • Read and followed this repo's Contributing Guidelines
  • Based your PR on the latest version of the correct branch (master or 4.x)
  • Checked your writing carefully for correct English spelling, grammar, etc
  • Described your changes and the motivation for them below
  • Noted what issue(s) this pull request resolves, creating one if needed

Description of Changes

This commit strips out the np.log transformation on rets_1, rets_2, and rets_3,
switching them to raw arithmetic returns via .pct_change().dropna() in line
with conventional portfolio return, volatility, and Sharpe ratio calculations.
No downstream functions were altered—they will now consume raw returns directly.

Note: log‐returns are still valuable for their multiplicative additivity. In
future updates, np.log should only be applied once to the AGGREGATED portfolio
return (i.e. after the dot‐product of weights and raw returns) to avoid
nonlinear distortions at the per‐asset level.

Issue(s) Resolved

Fixes #393

This commit strips out the np.log transformation on rets_1, rets_2, and rets_3,
switching them to raw arithmetic returns via `.pct_change().dropna()` in line
with conventional portfolio return, volatility, and Sharpe ratio calculations.
No downstream functions were altered—they will now consume raw returns directly.

Note: log‐returns are still valuable for their multiplicative additivity. In
future updates, np.log should only be applied once to the AGGREGATED portfolio
return (i.e. after the dot‐product of weights and raw returns) to avoid
nonlinear distortions at the per‐asset level.

Solves spyder-ide#393
@netlify
Copy link

netlify bot commented Aug 16, 2025

Deploy Preview for spyder-docs-preview ready!

Name Link
🔨 Latest commit d29b946
🔍 Latest deploy log https://app.netlify.com/projects/spyder-docs-preview/deploys/689ff6abdeb8f400082b9cae
😎 Deploy Preview https://deploy-preview-394--spyder-docs-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

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.

Incorrect portfolio return calculation in financial workshop documentation

1 participant