Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

precise-0.10.29.tar.gz (80.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

precise-0.10.29-py3-none-any.whl (138.0 kB view details)

Uploaded Python 3

File details

Details for the file precise-0.10.29.tar.gz.

File metadata

  • Download URL: precise-0.10.29.tar.gz
  • Upload date:
  • Size: 80.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for precise-0.10.29.tar.gz
Algorithm Hash digest
SHA256 7282ca7a3878f15a9e6196deee6b5aada7ea1224d2e41ab482039d7810f32bf2
MD5 30e05676872e23f8249bbbbd0bdcf0a3
BLAKE2b-256 b1bce49e814f55c036d0c40e3687f153ff748a416bc19f0d7a96e7f211428fdc

See more details on using hashes here.

File details

Details for the file precise-0.10.29-py3-none-any.whl.

File metadata

  • Download URL: precise-0.10.29-py3-none-any.whl
  • Upload date:
  • Size: 138.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.6

File hashes

Hashes for precise-0.10.29-py3-none-any.whl
Algorithm Hash digest
SHA256 18c7026d4f00a493e6d6940d8f969e38263a9c5ba9de90a729ea195f4a7dbc1d
MD5 eb8c8b428529d003a69ef9f7fc8a2ef2
BLAKE2b-256 40473a7a3827a4523e52c103b54d58d1cfd4558722abf8f20e552a0f8f4c555d

See more details on using hashes here.

Release history Release notifications | RSS feed

1.0.0

2 files

0.16.7

2 files

0.16.3

2 files

0.16.2

2 files

0.16.1

2 files

0.15.0

2 files

0.14.1

2 files

0.14.0

2 files

0.13.5

2 files

0.13.4

2 files

0.13.2

2 files

0.13.0

2 files

0.12.8

2 files

0.12.7

2 files

0.12.5

2 files

0.12.4

2 files

0.12.2

2 files

0.12.1

2 files

0.12.0

2 files

0.11.17

2 files

0.11.15

2 files

0.11.14

2 files

0.11.13

2 files

0.11.12

2 files

0.11.10

2 files

0.11.9

2 files

0.11.8

2 files

0.11.7

2 files

0.10.33

2 files

This release

0.10.29 This release

2 files

0.10.28

2 files

0.10.21

2 files

0.10.14

2 files

0.10.4

2 files

0.10.3

2 files

0.10.1

2 files

0.10.0

2 files

0.9.5

2 files

0.9.1

2 files

0.8.7

2 files

0.8.1

2 files

0.8.0

2 files

0.7.5

2 files

0.7.3

2 files

0.7.1

2 files

0.7.0

2 files

0.6.10

2 files

0.6.1

2 files

0.5.21

2 files

0.5.16

2 files

0.5.13

2 files

0.5.12

2 files

0.5.11

2 files

0.5.10

2 files

0.5.9

2 files

0.5.7

2 files

0.5.5

2 files

0.4.18

2 files

0.4.0

2 files

0.3.14

2 files

0.3.13

2 files

0.3.1

2 files

0.1.0

2 files

0.0.2

2 files

0.0.1

2 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