MV Port is a Python package to perform Mean-Variance Analysis. It provides a Portfolio class with a variety of methods to help on your portfolio optimization tasks.
Project description
=======================
Mean Variance Portfolio
=======================
.. image:: https://img.shields.io/pypi/v/mvport.svg
:target: https://pypi.python.org/pypi/mvport
.. image:: https://img.shields.io/travis/condereis/mean-variance-portfolio.svg
:target: https://travis-ci.org/condereis/mean-variance-portfolio
.. image:: https://readthedocs.org/projects/mean-variance-portfolio/badge/?version=latest
:target: https://mean-variance-portfolio.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/condereis/mean-variance-portfolio/shield.svg
:target: https://pyup.io/repos/github/condereis/mean-variance-portfolio/
:alt: Updates
MV Port is a Python package to perform Mean-Variance Analysis. It provides a Portfolio class with a variety of methods to help on your portfolio optimization tasks.
* Free software: MIT license
* Documentation: https://mvport.readthedocs.io.
.. Modern portfolio theory (MPT), or mean-variance analysis, is a mathematical framework for assembling a portfolio of assets such that the expected return is maximized for a given level of risk. It is a formalization and extension of diversification in investing, the idea that owning different kinds of financial assets is less risky than owning only one type. Its key insight is that an asset's risk and return should not be assessed by itself, but by how it contributes to a portfolio's overall risk and return. It uses the variance of asset prices as a proxy for risk.
Features
--------
* Easy portfolio setup
* Portfolio evaluation
* Random portfolio allocation
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate
Installation
------------
To install MV Port, run this command in your terminal:
.. code:: bash
$ pip install mvport
Check `here <https://mvport.readthedocs.io/en/latest/installation.html>`_ for further information on installation.
Basic Usage
-----------
Instantiate a portfolio and add some stock and evaluate it given a set of weights:
.. code:: python
>>> import mvport as mv
>>> p = mv.Portfolio()
>>> p.add_stock('AAPL', [.1,.2,.3])
>>> p.add_stock('AMZN', [.1,.3,.5])
>>> mean, variance, sharp_ratio, weights = p.evaluate([.5, .5])
>>> print '{} +- {}'.format(mean, variance)
0.25 +- 0.0225
Check `here <https://mvport.readthedocs.io/en/latest/usage.html>`_ for further information on usage.
=======
History
=======
1.0.0 (2018-06-28)
------------------
* First release on PyPI.
* Stock class implemented.
* Portfolio class implemented.
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate
1.0.1 (2018-06-28)
------------------
* Minor ajusts.
1.0.2 (2018-06-28)
------------------
* Minor ajusts.
1.1.0 (2018-08-05)
------------------
* Portfalio evaluation given actual stocks returns.
1.2.0 (2019-03-27)
------------------
* Calculating the optimization problem manualy so cvxopt is no longer necessary.
Mean Variance Portfolio
=======================
.. image:: https://img.shields.io/pypi/v/mvport.svg
:target: https://pypi.python.org/pypi/mvport
.. image:: https://img.shields.io/travis/condereis/mean-variance-portfolio.svg
:target: https://travis-ci.org/condereis/mean-variance-portfolio
.. image:: https://readthedocs.org/projects/mean-variance-portfolio/badge/?version=latest
:target: https://mean-variance-portfolio.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status
.. image:: https://pyup.io/repos/github/condereis/mean-variance-portfolio/shield.svg
:target: https://pyup.io/repos/github/condereis/mean-variance-portfolio/
:alt: Updates
MV Port is a Python package to perform Mean-Variance Analysis. It provides a Portfolio class with a variety of methods to help on your portfolio optimization tasks.
* Free software: MIT license
* Documentation: https://mvport.readthedocs.io.
.. Modern portfolio theory (MPT), or mean-variance analysis, is a mathematical framework for assembling a portfolio of assets such that the expected return is maximized for a given level of risk. It is a formalization and extension of diversification in investing, the idea that owning different kinds of financial assets is less risky than owning only one type. Its key insight is that an asset's risk and return should not be assessed by itself, but by how it contributes to a portfolio's overall risk and return. It uses the variance of asset prices as a proxy for risk.
Features
--------
* Easy portfolio setup
* Portfolio evaluation
* Random portfolio allocation
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate
Installation
------------
To install MV Port, run this command in your terminal:
.. code:: bash
$ pip install mvport
Check `here <https://mvport.readthedocs.io/en/latest/installation.html>`_ for further information on installation.
Basic Usage
-----------
Instantiate a portfolio and add some stock and evaluate it given a set of weights:
.. code:: python
>>> import mvport as mv
>>> p = mv.Portfolio()
>>> p.add_stock('AAPL', [.1,.2,.3])
>>> p.add_stock('AMZN', [.1,.3,.5])
>>> mean, variance, sharp_ratio, weights = p.evaluate([.5, .5])
>>> print '{} +- {}'.format(mean, variance)
0.25 +- 0.0225
Check `here <https://mvport.readthedocs.io/en/latest/usage.html>`_ for further information on usage.
=======
History
=======
1.0.0 (2018-06-28)
------------------
* First release on PyPI.
* Stock class implemented.
* Portfolio class implemented.
* Minimum Variance Portfolio optimization
* Efficient Frontier evaluation
* Tangency Portfolio for a given risk free return rate
1.0.1 (2018-06-28)
------------------
* Minor ajusts.
1.0.2 (2018-06-28)
------------------
* Minor ajusts.
1.1.0 (2018-08-05)
------------------
* Portfalio evaluation given actual stocks returns.
1.2.0 (2019-03-27)
------------------
* Calculating the optimization problem manualy so cvxopt is no longer necessary.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mvport-1.2.0.tar.gz
(13.8 kB
view hashes)
Built Distribution
Close
Hashes for mvport-1.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c56054eb8054184f21b6c0ae13566c4a4f9498bba30a9f3e2c911a1d696dbc5a |
|
MD5 | 5d59b433b067358131008461a22edab3 |
|
BLAKE2b-256 | 6364e6873e6c2f5d781e6d28ee67774c586b731f6fa3c1b69ec4a64d7e27aeb2 |