This package provides "rough path" tools for analysing vector time series.
Project description
esig
The Python package esig provides a toolset (previously called sigtools) for transforming vector time series in stream space to signatures in effect space. It is based on the libalgebra C++ library.
Installation
esig can be installed from a wheel using pip in most cases. The wheels contain all of the dependencies and thus make it easy to use the package. For example, on Python 3.8, you can install esig using the following console command:
python3.8 -m pip install esig
(You may need to tweak this command based on your platform, Python version, and preferences.)
esig can be compiled from source, but this is not advised. More information can be found in the documentation.
Basic usage
esig provides a collection of basic functions for computing the signature of a data stream in the form of a Numpy array.
The stream2sig
function computes the signature of a data stream up to a specific depth.
For example, we can create a very simple data stream and compute its signature as follows.
import numpy as np
import esig
stream = np.array([
[1.0, 1.0],
[3.0, 4.0],
[5.0, 2.0],
[8.0, 6.0]
])
depth = 2
sig = esig.stream2sig(stream, depth) # compute the signature
print(sig) # prints "[1.0, 7.0, 5.0, 24.5, 19.0, 16.0, 12.5]"
The signature is returned as a flat Numpy array that contains the terms of the signature - which is fundamentally a higher dimensional tensor - in degree order.
This first element is always 1.0, which corresponds to the empty tensor key.
In this case the dimension is 2 (specified by the number of columns in the stream array), and so the next two elements are the signature elements corresponding to the words (1) and (2).
These are the depth 1 words.
The final 4 elements are the depth 2 words (1,1), (1,2), (2,1), and (2,2).
esig provides the sigkeys
function to generate these labels for you based on the parameters of the data.
width = 2
sig_keys = esig.sigkeys(width, depth)
print(sig_keys) # prints " () (1) (2) (1,1) (1,2) (2,1) (2,2)"
To compute the log signature of a data stream you use the stream2logsig
function.
This works in a similar manner to the stream2sig
function in that it takes a Numpy array (the data) and a depth and returns a flat Numpy array containing the elements of the log signature in degree order.
log_sig = esig.stream2logsig(stream, depth)
print(log_sig) # prints "[7. 5. 1.5]"
Here the first two elements are the depth 1 Lie elements (corresponding to the letters 1 and 2) and the third element is the coefficient of the Hall basis element [1,2].
Again, esig provides a utility function logsigkeys
for getting the keys that correspond to the coefficients in order for the log signature.
log_sig_keys = esig.logsigkeys(width, depth)
print(log_sig_keys) # prints " 1 2 [1,2]"
There are two additional utility functions for computing the size of a signature or logsignature with a specified dimension and depth: sigdim
and logsigdim
.
These functions return an integer that is the dimension of the Numpy array returned from the stream2sig
or stream2logsig
functions, respectively.
esig also provides another function recombine
, which performs a reduction of a measure defined on a large ensemble in a way so that the resulting measure has the same total mass, but is supported on a (relatively) small subset of the original ensemble.
In particuar, the expected value over the ensemble with respect to the new measure agrees with that of the original measure.
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
Built Distributions
File details
Details for the file esig-0.8.0.tar.gz
.
File metadata
- Download URL: esig-0.8.0.tar.gz
- Upload date:
- Size: 81.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 979bbfdfd30592d8ecbbe32a8ddc6af134d4d134504902b3db5fd4d882010e28 |
|
MD5 | 3623c772f021afbe1aa12f8c57603595 |
|
BLAKE2b-256 | 2b5469c1eec0a8c0b7dc7099e1912588c5bd18fab4908efd29ff7249d317f7f8 |
File details
Details for the file esig-0.8.0-cp38-cp38-win_amd64.whl
.
File metadata
- Download URL: esig-0.8.0-cp38-cp38-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.8, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a552d7b79fe716cba2dc8f0e9c5608cbb211018e58419ac03624eb3f8b0c033 |
|
MD5 | d1dec70959a6d69649d4f2d9d82dc5ed |
|
BLAKE2b-256 | 1f9744c8832d5fd629222405a471bb5abef0cbf031cf032f7994fceb0f3cdbd8 |
File details
Details for the file esig-0.8.0-cp38-cp38-manylinux2014_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 41.8 MB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | dc9cee55457cb39a7be4eef771b785e04fe96b856cc3ce16c43d4f3ff67ef283 |
|
MD5 | 8e2406722f5ec09f98b2cdf622d6792e |
|
BLAKE2b-256 | 915d2489a763e029135976e806baa3083748244cefd9c4fc6d65b297821f837c |
File details
Details for the file esig-0.8.0-cp38-cp38-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp38-cp38-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.8, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61d26af923a389508a510c36bea87b556733ae148cfbf366bbedbbce37ef42e3 |
|
MD5 | e67337d96a147d22746db5660a281c0d |
|
BLAKE2b-256 | 1132efc0cc83b10e980408286fe0ea760637264d7d5c32bc3b981cde9159d338 |
File details
Details for the file esig-0.8.0-cp37-cp37m-win_amd64.whl
.
File metadata
- Download URL: esig-0.8.0-cp37-cp37m-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.7m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0ff024165b449640cedaa6a5608e76ebfcf5aba1d509afad724f0bfa80e199eb |
|
MD5 | 9fb417ac932b528ae32c1163f81eb0ab |
|
BLAKE2b-256 | 09506090d68006a9c6901d621d04aa1adf6f5bafab9910ef8a23e0113ad0b6f3 |
File details
Details for the file esig-0.8.0-cp37-cp37m-manylinux2014_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp37-cp37m-manylinux2014_x86_64.whl
- Upload date:
- Size: 41.8 MB
- Tags: CPython 3.7m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8e68a267efa500c57d3693deb0ff87b8eab08cb653b6ff54f245a83bdab62a1a |
|
MD5 | db4e49b692e7e16cf58ef4918927834e |
|
BLAKE2b-256 | db75298c9bc85d1565353019c8ff8d6f59d9bda695ac304d96410d861a8eef5a |
File details
Details for the file esig-0.8.0-cp37-cp37m-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp37-cp37m-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.7m, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 442bcc637ad48c1e452f94e08a7abb6b6394e20ea1af588f210e443c150741c3 |
|
MD5 | 5338fb3841850157c92fd676cde5b2c3 |
|
BLAKE2b-256 | da5c3c024a875d07d0742aa797c7f4966b5c188057fc65e45755660e2f56d3f7 |
File details
Details for the file esig-0.8.0-cp36-cp36m-win_amd64.whl
.
File metadata
- Download URL: esig-0.8.0-cp36-cp36m-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.6m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d1177cc71b3b34b6af68486ec57ddfc3fc7fe9dde3dc2acef7e57a7b65c7b1d |
|
MD5 | 0e3ba6dd9db048d078487b5114a22d80 |
|
BLAKE2b-256 | 24be9fc46bbeefda72fec7bab541b360dafb4c8c6a552e3def1949ca7cb93dac |
File details
Details for the file esig-0.8.0-cp36-cp36m-manylinux2014_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp36-cp36m-manylinux2014_x86_64.whl
- Upload date:
- Size: 41.8 MB
- Tags: CPython 3.6m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c676ff6063ef0e76f0cffb9cdd01616ecfba0feb065144f62ab8b4c337f1f01a |
|
MD5 | 495508bd10cd5a5f9c222d1d05830b26 |
|
BLAKE2b-256 | 0108da7e5db2aee26b6bced98aef0e4fba8bfda2cd519a99f232bc0f7663a79f |
File details
Details for the file esig-0.8.0-cp36-cp36m-macosx_10_15_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp36-cp36m-macosx_10_15_x86_64.whl
- Upload date:
- Size: 4.1 MB
- Tags: CPython 3.6m, macOS 10.15+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b39988273c3a97e7f36a968eaeee2edae2e37172383fb8ab2ae92cdc658c4926 |
|
MD5 | c91bd6b3076a286d0812979581894c71 |
|
BLAKE2b-256 | dc82e131563ab088b53aceb09b6f42b4a87e5db44580b3d71345bb3fcea6ac8c |
File details
Details for the file esig-0.8.0-cp35-cp35m-win_amd64.whl
.
File metadata
- Download URL: esig-0.8.0-cp35-cp35m-win_amd64.whl
- Upload date:
- Size: 3.8 MB
- Tags: CPython 3.5m, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2339c984857b19bade03ef3cd306ad81722d2ee0fdc468839bd03ecdceed98c |
|
MD5 | 22291bef6dcd1f92a2380e87bdd7eb28 |
|
BLAKE2b-256 | 757e0fca597a762889207e9ebadb510a0df19428b44e791bf600d3c47dbe24ed |
File details
Details for the file esig-0.8.0-cp35-cp35m-manylinux2014_x86_64.whl
.
File metadata
- Download URL: esig-0.8.0-cp35-cp35m-manylinux2014_x86_64.whl
- Upload date:
- Size: 41.8 MB
- Tags: CPython 3.5m
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d16871edcc1d1317d578757309cb764bda2de2149be81800200f04f777a0fdc7 |
|
MD5 | 1fbe062c3ed377c624b5c19912ccf012 |
|
BLAKE2b-256 | f635c6dfa839c4c5c91c675f85abdaba16f2f05629690b16c9c75614f9f694c1 |