Skip to main content

Stationary Subspace Analysis for temporal and spatial data

Project description

pyssaBSS

PyPI version 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.2.tar.gz (45.8 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.2-cp312-cp312-win_amd64.whl (117.4 kB view details)

Uploaded CPython 3.12Windows x86-64

pyssabss-0.1.2-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.2-cp311-cp311-win_amd64.whl (115.7 kB view details)

Uploaded CPython 3.11Windows x86-64

pyssabss-0.1.2-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.2-cp310-cp310-win_amd64.whl (115.3 kB view details)

Uploaded CPython 3.10Windows x86-64

pyssabss-0.1.2-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.2-cp39-cp39-win_amd64.whl (115.7 kB view details)

Uploaded CPython 3.9Windows x86-64

pyssabss-0.1.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (119.9 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.2.tar.gz.

File metadata

  • Download URL: pyssabss-0.1.2.tar.gz
  • Upload date:
  • Size: 45.8 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.2.tar.gz
Algorithm Hash digest
SHA256 b15acd993cf11cc146959bd0122c41ac88ec9e2d64fbddbc7fbbea882eccedcd
MD5 7a2543d9fe1147312cbc22a6094a55f9
BLAKE2b-256 694fa0b24db8172cbafb11bd28a24aede4d7e1f1f807bfefa0db96054930a2ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2.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.2-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.2-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 117.4 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.2-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7f3b5ce1a85d2de46930f2d0c6036f9d8e168a8300aa15baa6cd9e4f7331e4de
MD5 38b91a9f291388e26208784f7dfc2e78
BLAKE2b-256 05bc2ea2250ffee939299714732201497f52ede239dc79351db066d87137fe6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.2-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b5ce6d73571d91254bd4e03aac01aa8a70667838013e1d692c925c2dc740cf90
MD5 b5a978e5fbf33262cfd8615bfae43501
BLAKE2b-256 33accedccc7fea5af615426572ca5553706e61729fdb528e10fd740184cc2b47

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.2-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.2-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 7d3c21bdd2c3f5dddcedcf4d1b61d134184d515698bbe6c93d47ae53c54350a5
MD5 91bff0418adc1bc13639ed4382943c28
BLAKE2b-256 5ed75590bc4dd4d3ec131a1647a5d250e7bc4783a4ff769515a2b92c4c079c38

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.2-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 d7b443f048fccdcac905226b7786c74ef8bc9afc3d48c78788a5770ccf826a75
MD5 f1a4e76e8941982b53ad291516c3f5bf
BLAKE2b-256 de41a97d51906c05b0a3f55bc9b8d17d5635485770a97a99c733377c657fbbee

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.2-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 115.3 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.2-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4216bc3b7b05c0b7716a0919cc97d0f1b716f6ade2fd359e8e0bb6a13e4b314f
MD5 5bf71ed2a7831fee58a1448ec1c34338
BLAKE2b-256 aff83b5cee93a863328aa08588d18141ee0a8ceaaeffbb3e9f5677152750333b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.2-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e4bbb17723bcbcb89ea080c7ea7fd5029de2d034bead34167f1eb9b8822453d8
MD5 0a1b968a6b5ff91141302ea017c8b5de
BLAKE2b-256 b7c33b9ed2b06f18a71ff53d29f2a73f59915fcb54be80c45b3a7c604722d79c

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp39-cp39-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.2-cp39-cp39-win_amd64.whl
  • Upload date:
  • Size: 115.7 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.2-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 dfc2303d3e47df1de7a119d59eee85d40476258636a78f81ae95940e4c5ea4a2
MD5 6f8b8783831a2a5b9075db9fed589c99
BLAKE2b-256 5f123de403405e3063eca78c58258da7b2ec6df07f52701387ec8309d5ac7823

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.2-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 904923faef226c9c141719f64de03d66d8bcea42ab148e977957356fa87fd068
MD5 f84614b9d438cc2413003e161afc7687
BLAKE2b-256 5252a2021320c33ef9125ff7345b2ed0e5ed279cc00de530dc571f68e7c4b7d3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.2-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