Added support for multi-asset portfolio and general improvements#1
Open
matteorosato wants to merge 7 commits into
Open
Added support for multi-asset portfolio and general improvements#1matteorosato wants to merge 7 commits into
matteorosato wants to merge 7 commits into
Conversation
…list function minor change in docstring
… multiple assets modified simulate_multiple_investments and simulate_multiple_durations to handle extra parameter portfolio_composition modified tests in test_simulations.py
matteorosato
commented
Jan 3, 2025
Author
There was a problem hiding this comment.
@apalladi this is more a general question: why are we using average capital instead of total one when computing the gross return?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request adds support for multi-asset portfolio while maintaining backward compatibility with the original single-asset behavior. The update introduces a new
simulate_portfolio_returnsfunction to simulate investments in portfolios composed of multiple assets, with customizable portfolio composition.A Jupyter Notebook
CustomPortfolio.ipynbhas been added to demonstrate how to use the tool with a sample two-fund portfolio.Key Changes:
simulate_portfolio_returns:simulate_multiple_investments:portfolio_compositionis provided, the function callssimulate_portfolio_returns. If no composition is provided, it defaults to the original behavior of simulating single asset investments.simulate_multiple_durations:portfolio_compositionargument tosimulate_multiple_investments, enabling simulations for multiple durations with multi-asset portfolios.New Notebook:
Notebooks/CustomPortfolio.ipynb:Tests:
unittestframework.Improved
README:README.mdhas been updated to reflect the latest changes, including extra information on installation and usage.Improved
import_datafunction:import_datafunction has been improved to handle multiple DataFrames more efficiently.