https://github.com/anuragagrawaal/pyportfolioanalysis

'Portfolio Analysis, methods for portfolio optimization'

https://github.com/anuragagrawaal/pyportfolioanalysis

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 12 DOI reference(s) in README
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (13.3%) to scientific vocabulary

Keywords

finance financial-data financial-engineering jupyter-notebook mathematical-modelling optimization optimization-methods portfolio-construction portfolio-management portfolio-optimization portfoliomanager portfoliooptimization python python3 quantitative-finance scipy statistics
Last synced: 5 months ago · JSON representation

Repository

'Portfolio Analysis, methods for portfolio optimization'

Basic Info
  • Host: GitHub
  • Owner: anuragagrawaal
  • License: agpl-3.0
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 3.35 MB
Statistics
  • Stars: 23
  • Watchers: 1
  • Forks: 4
  • Open Issues: 1
  • Releases: 0
Topics
finance financial-data financial-engineering jupyter-notebook mathematical-modelling optimization optimization-methods portfolio-construction portfolio-management portfolio-optimization portfoliomanager portfoliooptimization python python3 quantitative-finance scipy statistics
Created about 5 years ago · Last pushed about 5 years ago
Metadata Files
Readme Funding License

README.md

pyPortfolioAnalysis

pyPortfolioAnalysis is a Python library for numeric method for portfolio optimisation.

Installation

Use the package manager pip to install pyPortfolioAnalysis.

Documentation is available as docstring, HTML or Text

bash pip install pyPortfolioAnalysis

Usage

```python from pyPortfolioAnalysis import * import pandas as pd

Sample portfolio optimisation

import pandasdatareader as pdr aapl = pdr.getdatayahoo('AAPL') msft = pdr.getdatayahoo('MSFT') tsla = pdr.getdatayahoo('TSLA') uber = pdr.getdatayahoo('UBER') amzn = pdr.getdatayahoo('AMZN') port = pd.DataFrame({'aapl': pd.DataFrame.resetindex(aapl).iloc[:,6], 'msft':pd.DataFrame.resetindex(msft).iloc[:,6], 'tsla': pd.DataFrame.resetindex(tsla).iloc[:,6], 'uber': pd.DataFrame.resetindex(uber).iloc[:,6], 'amzn': pd.DataFrame.resetindex(amzn).iloc[:,6]}) portret = port.pctchange().dropna() p1 = portfoliospec(assets = ['AAPL', 'MSFT', 'TSLA', 'UBER', 'AMZN']) addconstraint(p1, 'longonly') addconstraint(p1, 'fullinvestment') addobjective(p1, kind='return', name = 'mean', target = 0.002) addobjective(p1, kind='risk', name = 'std', target = .018) p1.portsummary() constraints = getconstraints(p1) p1.portsummary()

optimizeportfolio(portret, p1, optimize_method = 'DEoptim', disp = False) ```

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

Authors

Anurag Agrawal

paypal

License

GPL3

References

Brian G. Peterson and Peter Carl (2018). PortfolioAnalytics: Portfolio Analysis, Including Numerical Methods for Optimization of Portfolios. R package version 1.1.0. https://CRAN.R-project.org/package=PortfolioAnalytics

Boudt, Kris and Lu, Wanbo and Peeters, Benedict, Higher Order Comoments of Multifactor Models and Asset Allocation (June 16, 2014). Available at SSRN: http://ssrn.com/abstract=2409603 or http://dx.doi.org/10.2139/ssrn.2409603

Chriss, Neil A and Almgren, Robert, Portfolios from Sorts (April 27, 2005). Available at SSRN: http://ssrn.com/abstract=720041 or http://dx.doi.org/10.2139/ssrn.720041

Meucci, Attilio, The Black-Litterman Approach: Original Model and Extensions (August 1, 2008). Shorter version in, THE ENCYCLOPEDIA OF QUANTITATIVE FINANCE, Wiley, 2010. Avail- able at SSRN: http://ssrn.com/abstract=1117574 or http://dx.doi.org/10.2139/ssrn.1117574

Meucci, Attilio, Fully Flexible Views: Theory and Practice (August 8, 2008). Fully Flexible Views: Theory and Practice, Risk, Vol. 21, No. 10, pp. 97-102, October 2008. Available at SSRN: http://ssrn.com/abstract=1213325

Scherer, Bernd and Martin, Doug, Modern Portfolio Optimization. Springer. 2005.

Shaw, William Thornton, Portfolio Optimization for VAR, CVaR, Omega and Utility with General Return Distributions: A Monte Carlo Approach for Long-Only and Bounded Short Portfolios with Optional Robustness and a Simplified Approach to Covariance Matching (June 1, 2011). Available at SSRN: http://ssrn.com/abstract=1856476 or http://dx.doi.org/10.2139/ssrn.1856476

Downloads

Owner

  • Name: Anurag Agrawal
  • Login: anuragagrawaal
  • Kind: user
  • Location: Bangalore, India
  • Company: Morningstar, Inc

Passionately analyse financial markets, build algorithms for trading; interest in Quantitative Analysis; Derivatives Pricing; Portfolio Management/Analysis.

GitHub Events

Total
  • Issues event: 1
  • Watch event: 1
Last Year
  • Issues event: 1
  • Watch event: 1

Committers

Last synced: over 1 year ago

All Time
  • Total Commits: 34
  • Total Committers: 1
  • Avg Commits per committer: 34.0
  • Development Distribution Score (DDS): 0.0
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
anuragagrawaal 5****l 34

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 3
  • Total pull requests: 1
  • Average time to close issues: about 3 hours
  • Average time to close pull requests: about 3 hours
  • Total issue authors: 2
  • Total pull request authors: 1
  • Average comments per issue: 0.33
  • Average comments per pull request: 1.0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • Ashish0804 (2)
  • c-vision (1)
  • mohmmedaasim (1)
Pull Request Authors
  • Ashish0804 (1)
Top Labels
Issue Labels
Pull Request Labels

Packages

  • Total packages: 1
  • Total downloads:
    • pypi 7 last-month
  • Total dependent packages: 0
  • Total dependent repositories: 1
  • Total versions: 4
  • Total maintainers: 1
pypi.org: pyportfolioanalysis

Portfolio Analysis, methods for portfolio optimization

  • Versions: 4
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Downloads: 7 Last month
Rankings
Dependent packages count: 9.6%
Stargazers count: 13.6%
Forks count: 15.4%
Average: 20.1%
Dependent repos count: 21.9%
Downloads: 40.0%
Maintainers (1)
Last synced: 6 months ago

Dependencies

pyPortfolioAnalysis.egg-info/requires.txt pypi
  • matplotlib *
  • numpy *
  • pandas *
  • pyswarms *
  • pyyaml *
  • scipy *
requirements.txt pypi
  • matplotlib ==3.3.1
  • numpy ==1.19.2
  • pandas ==1.1.2
  • pyswarms ==1.2.0
  • scipy ==1.5.2