Skip to main content

Stationary Subspace Analysis for temporal and spatial data

Project description

pyssaBSS

CI License: GPL v3 Documentation

Stationary Subspace Analysis (SSA) for temporal and spatial data.

pyssaBSS implements methods for separating stationary and nonstationary subspaces in multivariate data, based on the joint eigen-decomposition of scatter operators. It provides SSA for time series and SPSSA for spatial fields.

Note that the C++ code used for joint diagonalization is taken from the CRAN R-package JADE under the GPL license. The original package can be found at: https://cran.r-project.org/package=JADE


Installation

pip install pyssaBSS

Pre-built wheels are available for Windows, macOS, and Linux (Python 3.8–3.13). No compiler required.

Building from source

git clone https://github.com/perttusaarela/pyssaBSS
cd pyssaBSS
pip install -e ".[dev]"

Requires CMake ≥ 3.15 and a C++14 compiler.


Quick example

import numpy as np
from pyssaBSS import SPSSA_COMB
from pyssaBSS.kernels import ScaledBallKernel
from pyssaBSS.spatial import partition_coordinates
# data: (n_signals, n_samples), coords: (n_samples, 2)
data   = np.random.randn(5, 400)
coords = np.random.uniform(0, 20, (400, 2))

# Partition the spatial domain
partition = partition_coordinates(coords, 3, 3, 20)

# Add nonstationarity in the mean to the last signal
for part in partition:
    data[-1, part] += np.random.uniform(low=-5, high=5)

# Decompose
model = SPSSA_COMB(data, coords, partition=partition, kernel=ScaledBallKernel(2.2))

# Estimate rank of non-stationary subspace
q = model.estimate_rank()
print(f"Estimated rank: {q}")

# Extract subspaces
stationary, non_stationary = model.subspaces(q)
print(f"Stationary subspace:     {stationary.shape}")
print(f"Non-stationary subspace: {non_stationary.shape}")

Overview

Class Data type Varies across
SSA Time series Time partitions
SPSSA Spatial fields Spatial segments

Convenience constructors (SSA_SIR, SPSSA_SIR, SPSSA_LCOR, SPSSA_COMB, ...) bundle a scatter operator and rank estimator into a single call.


License

GLP 3.0 — see LICENSE.txt.

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

pyssabss-0.1.1.tar.gz (45.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

pyssabss-0.1.1-cp312-cp312-win_amd64.whl (117.3 kB view details)

Uploaded CPython 3.12Windows x86-64

pyssabss-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (122.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyssabss-0.1.1-cp311-cp311-win_amd64.whl (115.7 kB view details)

Uploaded CPython 3.11Windows x86-64

pyssabss-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (121.1 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyssabss-0.1.1-cp310-cp310-win_amd64.whl (115.2 kB view details)

Uploaded CPython 3.10Windows x86-64

pyssabss-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (119.7 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

pyssabss-0.1.1-cp39-cp39-win_amd64.whl (115.6 kB view details)

Uploaded CPython 3.9Windows x86-64

pyssabss-0.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (119.8 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.24+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file pyssabss-0.1.1.tar.gz.

File metadata

  • Download URL: pyssabss-0.1.1.tar.gz
  • Upload date:
  • Size: 45.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyssabss-0.1.1.tar.gz
Algorithm Hash digest
SHA256 1956956d5b656a4c993d64c20f12d1dbabd91d2d2f101258063902cc33a74f58
MD5 7be1ace5df3570427e68658c99ec8ca7
BLAKE2b-256 d315deb95a35cd18d83be2965e21c609f5566e87ffdf3fe77ce8969e837f030c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1.tar.gz:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 117.3 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyssabss-0.1.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 25d07b07390a2f7641e573662af9fe36485a7185316d3e37b9d2f05f87e2070c
MD5 7dcebe8a48ef58881a560abe65537175
BLAKE2b-256 6cd453845bed3f4bddeeb2bbedae755f692e1941a990d9e6f1d18f230280d795

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp312-cp312-win_amd64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 108cb312d09a342a59f4dd9ccfabf28015fd6bd22128775567df0c4b8156d04e
MD5 56eec1ac36cc5d26fe6121c734b98447
BLAKE2b-256 3ecc9c0b7e280a6d3a335199571d98fb9c97722fbe4d6b8a062425e29d331ee6

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 115.7 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyssabss-0.1.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b68fa884bfdbde4f0641e4a52de77ade01f79dc899bba9647b5df7186112aadf
MD5 31cdd2f9c2edf815fe38ca0ed4d7f1a1
BLAKE2b-256 10957935e6416068a7a9122fc3d267fd579ab344a3728632f102af0f148841a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp311-cp311-win_amd64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ffa1440f884b48cb69d57c9f59177e31e258826d32ac0b943b2df5292fdf8dd1
MD5 5cd694d0e29db4ff600e0a595cfeaf6e
BLAKE2b-256 953514ab222167f8842cbbeef2afc48efd6c83a268d42e214d2a212c66b1bb19

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 115.2 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyssabss-0.1.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 442dad23d1d74dcedd7cd5f8ddb4b7d2e44af873e8b98b9d61afe222169a0bb3
MD5 c79cde83307d50f34cdf46b21c094cce
BLAKE2b-256 f89717bb2430c26bcd35224173a64a78ef01d64eb60104c3fea0fb9d16a55682

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp310-cp310-win_amd64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c95a0c3026c74f34188d547a42da30ec7c98c792cbf25d9b39b9c354a632a470
MD5 14fb66d64e17d042ff0a7964bddbf3e2
BLAKE2b-256 ca26c9033a510649e01d128e9c36ff996139bdd8cbccb87a40244a39d0593ded

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.1-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 115.6 kB
  • Tags: CPython 3.9, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for pyssabss-0.1.1-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 49d4297d6474f27e38d12e0c6cd2978dfb9f7e9fd094d224b2a609f9fe8e7f29
MD5 cb47e2aa93c5b8b423e0ab1edca2ee22
BLAKE2b-256 961c94265870a89938fd6e383ec1425e5bde9210dde50abe32ada8f791d6a71b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp39-cp39-win_amd64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyssabss-0.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 451e092052a56b5cfcbf9cb5698a11044c176e48b79abd425d93e90a0673ec0b
MD5 88de904b7bc8845d897b6e1bbaa95394
BLAKE2b-256 1eab8d8e417f27016a9e6a7626293c09da5c435b8de0bf61b7f0f999960c7a8c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.1-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl:

Publisher: publish.yml on perttusaarela/pyssaBSS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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