Running estimates of moments
Project description
momentum
A mini-package for computing the running univariate mean, variance, kurtosis and skew
- No dependencies ... not even numpy.
- No classes ... unless you want them.
- State is a dict, for trivial serialization.
- Tested against scipy, creme, statistics
For multivariate see precise
Install
%pip install momentum
Usage: running mean, var
from momentum import var_init, var_update
from pprint import pprint
m = var_init()
for x in [5,3,2.4,1.0,5.0]:
m = var_update(m,x)
pprint(m)
Usage: running mean, var, kurtosis and skew
from momentum import kurtosis_init, kurtosis_update
m = kurtosis_init()
for x in [5,3,2.4,1.0,5.0]:
m = kurtosis_update(m,x)
pprint(m)
File an issue if you need more help using this.
Usage: running recency-weighted mean, var
from momentum import rvar_init, rvar_update
from pprint import pprint
m = rvar_init(rho=0.01,n=15)
for x in [5,3,2.4,1.0,5.0]:
m = rvar_update(m,x)
pprint(m)
This will switch from running variance to a weighted variance after 15 data points.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
momentum-0.2.3.tar.gz
(5.7 kB
view details)
Built Distribution
File details
Details for the file momentum-0.2.3.tar.gz
.
File metadata
- Download URL: momentum-0.2.3.tar.gz
- Upload date:
- Size: 5.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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c3f80cf184c2d34eacca5ba5a92b03339f57039d6e24c1e71468f961e0b035d |
|
MD5 | f19e7933615ca54bc0eb8f89fb8b1365 |
|
BLAKE2b-256 | 8f4d35f668fb133aa101e38f29df751d80a9f59c7c5ea5f30be08cf72288a5cd |
File details
Details for the file momentum-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: momentum-0.2.3-py3-none-any.whl
- Upload date:
- Size: 6.9 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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ac44e5d905af2cbf0936d31cc77236fbdba441d9904b12e11560146f5021288 |
|
MD5 | d79c0ce5a626f81164ed2ece758110c0 |
|
BLAKE2b-256 | beed1c6232412b62e5385e35ead02fc6997b2c42ab9830c0fa310bcd8c85694b |