Skip to main content

precise

A collection of autonomous online (incremental) covariance matrix estimators.

Install

pip install precise 

Examples

See /examples_basic_usage

Explanation

You use state updaters, then functions of the state.

State updates

All updaters take a prior state and return a posterior state (dict). An empty dict is passed to initialize.

Example:

from precise.synthetic.generate import create_correlated_dataset
from precise.covariance.empirical import emp_pcov

if __name__=='__main__':
    xs = create_correlated_dataset(n=500)
    s = {}
    for x in xs:
        s = emp_pcov(s=s, x=x)
    pprint(s['scov'])

Naming hints:

Shorthand Intent
scov Sample covariance
pcov Population covariance
spre Sample precision
ppre Population precision

Method hints:

Shorthand Meaning
emp Empirical
ema Exponential weighted moving average
lz Le-Zhong variable-by-variable updating
lw (inspired by) Ledoit-Wolf

Some, such as OAS, don't need their own state tracking. See examples.

State functions & mutations

Three types of utilities exist

  1. The covariance/statefunctions are illustrated by the example running_oas_covariance.
  2. State covariatnce/statemutations do things like ensuring both covariance and precision matrices exist in the state. Or for instance: s = both_cov(s) ensures both sample and population covariances are present.
  3. Miscellaneous /covariance/matrixfunctions functions act directly on matrices.

Updater hyper-parameters

The intent is that methods are parameter free. However some not-quite autonomous methods admit just one additional scalar parameter r and that can make the creation of fully autonomous methods simpler, akin to the tuning of skaters explained here in the timemachines package.

Miscellaneous

  • Care to cite, some ideas here
  • If you just want univariate, and don't want numpy as a dependency, there is momentum.

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.1.0.tar.gz (14.7 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.1.0-py3-none-any.whl (18.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: precise-0.1.0.tar.gz
  • Upload date:
  • Size: 14.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for precise-0.1.0.tar.gz
Algorithm Hash digest
SHA256 95207d33def068465e85973507bc6d3ae17ae432c82693fd6670103fbbedc800
MD5 2ba5d9e3987d01c1b5e26df618553518
BLAKE2b-256 eb6d1867dde166b59f02cbd33ff28e5e36e572159aa33b8cb882263c9699d41e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: precise-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 18.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.27.1 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.10.1

File hashes

Hashes for precise-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 794cf1cf85ac47b81e2687c76f9ac19cdd9ce30be22bd59e35684ae1f157abd0
MD5 f57dd9e7be7b782e110428a73d249c51
BLAKE2b-256 df8bd9d19ec2ee9528f282669ef37f509174cbd2fca00b2e977c6732abb467dd

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

0.10.29

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

This release

0.1.0 This release

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