GithubHelp home page GithubHelp logo

howtobecalculated / precise Goto Github PK

View Code? Open in Web Editor NEW

This project forked from microprediction/precise

0.0 0.0 0.0 6.6 MB

World beating online covariance and portfolio construction.

License: Other

Python 60.41% Jupyter Notebook 39.59%

precise's Introduction

precise docs tests tests-scipy-173License: MIT

Methods for online covariance forecasting and portfolio construction. See the documentation and M6 Competition successes.

Usage example: covariance

Here y is a vector:

from precise.skaters.covariance.ewapm import ewa_pm_emp_scov_r005_n100 as f 
s = {}
for y in ys:
    x, x_cov, s = f(s=s, y=y)

This package contains lots of different "f"s. There is a LISTING_OF_COV_SKATERS with links to the code. See the covariance documentation.

Usage example: portfolio weights

Here y is a vector:

    from precise.skaters.managers.schurmanagers import schur_weak_pm_t0_d0_r025_n50_g100_long_manager as mgr
    s = {}
    for y in ys:
        w, s = mgr(s=s, y=y)

This package contains lots of "mgr"'s. There is a LISTING_OF_MANAGERS with links to respective code. See the manager documentation.

Other uses

This article illustrates the connection between portfolio theory and model ensembles. See also the colab notebook on which is is based.

Install

pip install precise 

or for latest:

pip install git+https://github.com/microprediction/precise.git

Trouble?

pip install --upgrade pip
pip install --upgrade setuptools 
pip install --upgrade wheel
pip install --upgrade osqp   # <-- Can be tricky on some systems see https://github.com/cvxpy/cvxpy/issues/1190#issuecomment-994613793
pip install --upgrade pyportfolioopt
pip install --upgrade riskparityportfolio
pip install --upgrade scipy
pip insatll --upgrade precise 

Miscellaneous remarks

  • Here is some related, and potentially related, literature.
  • This is a piece of the microprediction project aimed at creating millions of autonomous critters to distribute AI at low cost, should you ever care to cite the same. The uses include mixtures of experts models for time-series analysis, buried in timemachines somewhere.
  • If you just want univariate calculations, and don't want numpy as a dependency, there is momentum. However if you want univariate forecasts of the variance of something, as distinct from mere online calculations of the same, you might be better served by the timemachines package. In particular I would suggest checking the time-series elo ratings and the "special" category in particular, as various kinds of empirical moment time-series (volatility etc) are used to determine those ratings.
  • The name of this package refers to precision matrices, not numerical precision. This isn't a source of high precision covariance calculations per se. The intent is more in forecasting future realized covariance. Perhaps I'll include some more numerically stable methods from this survey to make the name more fitting. Pull requests are welcome!
  • The intent is that methods are parameter free. However some not-quite autonomous methods admit a few parameters (the factories).

Disclaimer

Not investment advice. Not M6 entry advice. Just a bunch of code subject to the MIT License disclaimers.

precise's People

Contributors

marcogorelli avatar microprediction avatar peterdcotton avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.