Skip to main content

Python Monte Carlo Efficient Frontier (PyMCEF) package

Purpose

PyMCEF is a python package that can generate efficient frontier based on Monte Carlo simulated returns.

A Quickstart tutorial

Benchmark

PyMCEF is based on axiomatic Second-order Stochastic dominance portfolio theory.

Absolute SemiDeviation and Fixed-target expected under performance are used as the risk measure for this stochastic programming problem. These two risk measures don’t have the theoretical flaw in mean variance model.

One example when mean variance model fails

User input

The Monte Carlo simulated returns for all the assets in the investment universe is the input and will be to used to train the efficient frontier.

(Optional) The returns as a validation set to measure the performance of the efficient frontier.

Computation results

The complete efficient frontier stored as a vector of efficient portfolios, each of which containing the following:

  1. A python dictionary, storing the asset index and weight in the portfolio

  2. In sample performance (Sharpe ratio etc.)

  3. The lower and upper bound for the risk tolerance producing this particular portfolio

  4. Validation performance, if validation Monte Carlo simulated returns are provided.

Advantage

This package implements the algorithm introduced by Prof. Robert J. Vanderbei in his Book: Linear Programming: Foundations and Extensions and paper Frontiers of Stochastically Nondominated Portfolios

This algorithm is very efficient, starting with risk tolerance (lagrangian multiplier) being infinite and the optimal portfolio being 100% in the asset with the largest average return, only portfolios on the efficient frontier will be visited. With the product of number of assets and number of simulated return less than 10 million, the time needed to construct the full efficient frontier is less than 1 minute.

Speed comparison on efficient frontier construction with other LP solvers

https://github.com/hzzyyy/pymcef/blob/master/output/performance.png

This algorithm is based on simulated returns so it is model agnostic

This introduce huge flexibility to the user as no assumption is made on the type of return distribution (e.g. Gaussian).

Release files for pymcef 0.2.8

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distributions (wheels)

Table of built distributions (wheels) for pymcef 0.2.8
File
pymcef-0.2.8-cp36-cp36m-win_amd64.whl CPython 3.6 CPython 3.6 pymalloc Windows x86-64 Details
pymcef-0.2.8-cp36-cp36m-macosx_10_7_x86_64.whl CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64 Details
pymcef-0.2.8-cp35-cp35m-win_amd64.whl CPython 3.5 CPython 3.5 pymalloc Windows x86-64 Details
pymcef-0.2.8-cp35-cp35m-macosx_10_7_x86_64.whl CPython 3.5 CPython 3.5 pymalloc macOS 10.7+ x86-64 Details
pymcef-0.2.8-cp27-cp27m-win_amd64.whl CPython 2.7 CPython 2.7 pymalloc Windows x86-64 Details
pymcef-0.2.8-cp27-cp27m-macosx_10_7_x86_64.whl CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64 Details

Total release size: 486.4 kB

Release files / pymcef-0.2.8-cp36-cp36m-win_amd64.whl

Download URL pymcef-0.2.8-cp36-cp36m-win_amd64.whl
Size 71.5 kB
Tags CPython 3.6 CPython 3.6 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
94557e451817d8f9f8bef62d0b003445274d85b71efe3b5b5882d0b4f36da3d4
BLAKE2b-256 checksum
How to use checksums
ef0c09925d8a9a3ad3d87445484112a8731c8d57c09e401841a64ee169b8b7ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymcef-0.2.8-cp36-cp36m-macosx_10_7_x86_64.whl

Download URL pymcef-0.2.8-cp36-cp36m-macosx_10_7_x86_64.whl
Size 89.3 kB
Tags CPython 3.6 CPython 3.6 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
f2873a4182bea216ad07edd7f85e61ea39aec5d0a45bcb8006a34695d3ff90b4
BLAKE2b-256 checksum
How to use checksums
68059bf3c312b9fad3601b5db6adc26298271f37857c2bbe1d8f6f3589ae485b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymcef-0.2.8-cp35-cp35m-win_amd64.whl

Download URL pymcef-0.2.8-cp35-cp35m-win_amd64.whl
Size 71.5 kB
Tags CPython 3.5 CPython 3.5 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
38206c9a2f2f134ac35f91f54f3d7860ed8f3741a3f26684e3c10e0ed1d32804
BLAKE2b-256 checksum
How to use checksums
2a0f062affba6400c0d42bd7df40d9b12d1168d740bb70ea4ac20267976605e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymcef-0.2.8-cp35-cp35m-macosx_10_7_x86_64.whl

Download URL pymcef-0.2.8-cp35-cp35m-macosx_10_7_x86_64.whl
Size 89.2 kB
Tags CPython 3.5 CPython 3.5 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
4564a289ba554090d6e3a0388034a05d517faada7fb4c879aed71d2683dc8509
BLAKE2b-256 checksum
How to use checksums
b5b617e6f8c4c3b23cfd98b9f152a58643d36719757130b0c0f474b38468876b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymcef-0.2.8-cp27-cp27m-win_amd64.whl

Download URL pymcef-0.2.8-cp27-cp27m-win_amd64.whl
Size 75.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc Windows x86-64
SHA-256 checksum
How to use checksums
9cbbd78efb203aab806ef3212c106bc6898b947d4832adb4de5bd863b22b3f19
BLAKE2b-256 checksum
How to use checksums
81b17e66c1254880e4a87369c3a3dd9bfeb5465eeb2990856261a96a7342546c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / pymcef-0.2.8-cp27-cp27m-macosx_10_7_x86_64.whl

Download URL pymcef-0.2.8-cp27-cp27m-macosx_10_7_x86_64.whl
Size 90.0 kB
Tags CPython 2.7 CPython 2.7 pymalloc macOS 10.7+ x86-64
SHA-256 checksum
How to use checksums
37f5ed74053c75a82ffb3adec516f16e300686511d1206a63f7a93937e0868ef
BLAKE2b-256 checksum
How to use checksums
91d286371503e9c0c4dd0ac6ab6db702b6cade50db0bde41c68864ae9836afe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.2.8 This release

6 release files

0.2.7

7 release files

0.2.6

1 release file

0.2.5

8 release files

0.2.4

3 release files

0.2.3

4 release files

0.2.2

4 release files

0.2.0

4 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page