Package: precise
precisedocsContents:A collection ofonline(incremental)covariance forecastingandportfolio constructionfunctions. Seedocs."Schur Complementary" portfolio construction, a new approach that leans on connection between top-down (hierarchical) and bottom-up (optimization) portfolio construction revealed by block matrix inversion. See my posts on themethodologyand its role in thehijacking of the M6 contest.A small compendium of portfolio theory papers tilted towards my interests. Seeliterature.One observes that tools for portfolio construction might also be useful inoptimizing a portfolio of models.UsageSee thedocs, but briefly:Covariance estimationHere 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 aLISTING_OF_COV_SKATERSwith links to the code. See thecovariance documentation.Portfolio weightsHere 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 aLISTING_OF_MANAGERSwith links to respective code. See themanager documentation.Installpip install preciseor for latest:pip install git+https://github.com/microprediction/precise.gitTrouble? It probably isn't with precise per se.pip install --upgrade pip
pip install --upgrade setuptools 
pip install --upgrade wheel
pip install --upgrade ecos   # <--- Try conda install ecos if this fails
pip install --upgrade osqp   # <-- Can be tricky on some systems see https://github.com/cvxpy/cvxpy/issues/1190#issuecomment-994613793
pip install --upgrade pyportfolioopt # <--- Skip if you don't plan to use it
pip install --upgrade riskparityportfolio
pip install --upgrade scipy
pip install --upgrade preciseMiscellaneousHere 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 tocitethe same. The uses include mixtures of experts models for time-series analysis, buried intimemachinessomewhere.If you just want univariate calculations, and don't want numpy as a dependency, there ismomentum. 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 thetime-series elo ratingsand 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 covariancecalculationsper se. The intent is more in forecasting future realized covariance, conscious of the noise in the empirical distribution. Perhaps I'll include some more numerically stable methods fromthis surveyto 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).DisclaimerNot investment advice. Not M6 entry advice. Just a bunch of code subject to the MIT License disclaimers.