Skip to main content

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.

build

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.

Using alternative computation backends

esig uses libalgebra as a backend for computing signatures and log signatures by default. However, the computation backend can be changed to instead use an alternative library for computing signatures and log signatures. This is achieved by using the set_backend function in esig and providing the name of the backed that you wish to use. For example, we can switch to using the iisignature package as a backend by first installing the iisignature package and then using the command

import esig
esig.set_backend("iisignature")

To make it easier to install and use iisignature as a backend, it is offered as an optional extra when installing esig:

python3.8 -m pip install esig[iisignature]

You can also define your own backend for performing calculations by creating a class derived from esig.backends.BackendBase, implementing the methods describe_path (log_signature) and signature and related methods.

Project details


Download files

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

Source Distribution

esig-0.8.2.tar.gz (92.1 kB view details)

Uploaded Source

Built Distributions

esig-0.8.2-cp39-cp39-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.9 Windows x86-64

esig-0.8.2-cp39-cp39-manylinux2014_x86_64.whl (41.8 MB view details)

Uploaded CPython 3.9

esig-0.8.2-cp39-cp39-macosx_10_15_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.9 macOS 10.15+ x86-64

esig-0.8.2-cp38-cp38-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.8 Windows x86-64

esig-0.8.2-cp38-cp38-manylinux2014_x86_64.whl (41.8 MB view details)

Uploaded CPython 3.8

esig-0.8.2-cp38-cp38-macosx_10_15_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.8 macOS 10.15+ x86-64

esig-0.8.2-cp37-cp37m-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.7m Windows x86-64

esig-0.8.2-cp37-cp37m-manylinux2014_x86_64.whl (41.8 MB view details)

Uploaded CPython 3.7m

esig-0.8.2-cp37-cp37m-macosx_10_15_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.7m macOS 10.15+ x86-64

esig-0.8.2-cp36-cp36m-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.6m Windows x86-64

esig-0.8.2-cp36-cp36m-manylinux2014_x86_64.whl (41.8 MB view details)

Uploaded CPython 3.6m

esig-0.8.2-cp36-cp36m-macosx_10_15_x86_64.whl (4.1 MB view details)

Uploaded CPython 3.6m macOS 10.15+ x86-64

esig-0.8.2-cp35-cp35m-win_amd64.whl (3.8 MB view details)

Uploaded CPython 3.5m Windows x86-64

esig-0.8.2-cp35-cp35m-manylinux2014_x86_64.whl (41.8 MB view details)

Uploaded CPython 3.5m

File details

Details for the file esig-0.8.2.tar.gz.

File metadata

  • Download URL: esig-0.8.2.tar.gz
  • Upload date:
  • Size: 92.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2.tar.gz
Algorithm Hash digest
SHA256 f8e1b6995265cca6d41d0d13fd7fd84fdd50e15ea59eb07cf008b1160954fb61
MD5 13b4e2e20fab1e2dd57de6a3db28ce5e
BLAKE2b-256 bf538824eff48de16dcfa65ab2655f03fcf541efd6749090acb6dde837a842c2

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: esig-0.8.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 202d8022f9a9dfc09374984223ac9eac9bb9c69d2b5b2d1717259a89292cd518
MD5 b3952978c792b5d6f80da8cad9dda7bd
BLAKE2b-256 b577d62a9f0caf97b9b4c2cb45ae134615c238648511fecc858afc1cae282144

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp39-cp39-manylinux2014_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-cp39-cp39-manylinux2014_x86_64.whl
  • Upload date:
  • Size: 41.8 MB
  • Tags: CPython 3.9
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp39-cp39-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 63fdd4dad471889cff9fec881098c0d6f3312faae710617beafe78832e78f07f
MD5 239911c233b714d9e27b844a7e10bc05
BLAKE2b-256 337e7917e4d2f84efe3a085ed20635bf16ba70b24d37e387a1d88478c1edf487

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp39-cp39-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-cp39-cp39-macosx_10_15_x86_64.whl
  • Upload date:
  • Size: 4.1 MB
  • Tags: CPython 3.9, macOS 10.15+ x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 e58dddb4c1d1825ec00156f3c28a49d1f0c7db3611ba092c616919ea41e56c80
MD5 915429476c18dad07172d2c6db9fc290
BLAKE2b-256 5d5d1eff3229be6a5a14cb1764a8ff05488a8fb1d9e78b9dd46a87cc5f89885b

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp38-cp38-win_amd64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp38-cp38-win_amd64.whl
Algorithm Hash digest
SHA256 2bce945088892b2a449ba77e5a0d52de574662d9d6f8400dc2b4e0ac5ff08253
MD5 a3d77153ab7dae02cd0ec896509f508a
BLAKE2b-256 760017c38013482bf6a9d85cae79f6a17731d8b5e2a6527d3e8254af5985093f

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d9846436123501809b90f96dbda6a007cf5c1cfd2243052a04a38cb3bc9430a2
MD5 84180846338a9d7aaade8bbbfdfdd777
BLAKE2b-256 caf58e3ceffe71d58ea3aac077f406443c6e5475ab342f4377b276f72bea6cef

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp38-cp38-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 56148688d59a590c89914c5555a4261325742d8822135d5919328c7be8117df6
MD5 26cf36d553e297e078f8d8f654507f73
BLAKE2b-256 0f8fb5e3b571108df136721873c961b3292b5580af7f255d8773581b5550bb97

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp37-cp37m-win_amd64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp37-cp37m-win_amd64.whl
Algorithm Hash digest
SHA256 71b1e10085d1dfdba133119faa9957fb0911476e7747927a33cb0bc6e69238bd
MD5 a7973dffba9ea743f413a05aaea36a7b
BLAKE2b-256 87bdd269486dd80598b86a69355fae441dfca802af2b9e4a22f734e55b237807

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp37-cp37m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp37-cp37m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 219ee9c3246d0e70a6906c1732664887fa4322a2a4cff32c373b58d1a331d99c
MD5 c416099de7b5cc0fe093935047c0db49
BLAKE2b-256 47011425d19de5ebb088bb2a9eb28652100fcb86ebd321a464f4a48587981913

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp37-cp37m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 4d5563608c11782bdc3031c5130cc80cd282388dcb441c5e5a016aaaaa0f1000
MD5 0da0b69a0330c8f1711ed510c05672f2
BLAKE2b-256 e878d29a7fba7ae1327523ffd688cae4521afbcc3dd66bcaaa4b07681cf98b8c

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp36-cp36m-win_amd64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp36-cp36m-win_amd64.whl
Algorithm Hash digest
SHA256 cdb59ac0a94a2d39ebbf2274566163e938ed5ae8441dc8b67c99419bf7aac5b7
MD5 9c78a8fbc24146d4a006cc94a7891846
BLAKE2b-256 b16829d4c41a1532953ba90c9c08c59d077cdc07d134046517b3fe8ed722d138

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp36-cp36m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp36-cp36m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6a0726c8c9b2f30bb4b0e75cc4dc5319e6f8a40596fe54e70324903f9df5606a
MD5 1d5ea09c2316aef6cd729e0b8266d561
BLAKE2b-256 e11017580df581510664f51f3e9e474d483aa1abbde2a798a380ea0e3e699424

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp36-cp36m-macosx_10_15_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp36-cp36m-macosx_10_15_x86_64.whl
Algorithm Hash digest
SHA256 81d496d8a6b9ec24f31ab52714c6a71ac7309dea78c1cbe518f97098ed038122
MD5 9a37fb771b5a2f21dc4443ea381b5c25
BLAKE2b-256 59467eef3a2c886fa6da0622c732d14494cd3513995dc028b099435ddbe77931

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp35-cp35m-win_amd64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp35-cp35m-win_amd64.whl
Algorithm Hash digest
SHA256 80390a13e6e76ab4cfbfdb69e89ed9666eccca29ca4547263d3dbb2f3aa182d3
MD5 69207ff6a363946d9907f4b873c63c94
BLAKE2b-256 7c5877defc6ba09b4bd59f3bdeada6f15a6fe2b8b2c5405103a69b9353685565

See more details on using hashes here.

File details

Details for the file esig-0.8.2-cp35-cp35m-manylinux2014_x86_64.whl.

File metadata

  • Download URL: esig-0.8.2-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.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6

File hashes

Hashes for esig-0.8.2-cp35-cp35m-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6c0200e69343aa6e959b3454ff2c9c37faf0bdeb29282c79a9e202571a4ae839
MD5 b0d25fa36ce6d4150de7ec2a5a8a51a6
BLAKE2b-256 8ed12e244be3d0a5ad76e5131d70577820c2d9b3c7a006bc6c9cb1bf0bece8d2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page