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.5.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.5-cp313-cp313-win_amd64.whl (126.3 kB view details)

Uploaded CPython 3.13Windows x86-64

pyssabss-0.1.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (122.9 kB view details)

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

pyssabss-0.1.5-cp312-cp312-win_amd64.whl (126.2 kB view details)

Uploaded CPython 3.12Windows x86-64

pyssabss-0.1.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (123.0 kB view details)

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

pyssabss-0.1.5-cp311-cp311-win_amd64.whl (123.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pyssabss-0.1.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (121.3 kB view details)

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

pyssabss-0.1.5-cp310-cp310-win_amd64.whl (123.0 kB view details)

Uploaded CPython 3.10Windows x86-64

pyssabss-0.1.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (120.1 kB view details)

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

pyssabss-0.1.5-cp39-cp39-win_amd64.whl (123.2 kB view details)

Uploaded CPython 3.9Windows x86-64

pyssabss-0.1.5-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (120.2 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.5.tar.gz.

File metadata

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

File hashes

Hashes for pyssabss-0.1.5.tar.gz
Algorithm Hash digest
SHA256 35e0a6f887d9f611ed488d999403f6500fb13a287fe036921dbcc87fb22594c7
MD5 1f809916a187f7149971768ddfa05d23
BLAKE2b-256 b7ac8da983413f294d50f010d5410cfeb279b37a1234779274876776dec0b978

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.5.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.5-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pyssabss-0.1.5-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 126.3 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyssabss-0.1.5-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7d9c253dea1266e6a11b05da40e306df5a613a8c5128e840023bc37bd81e1940
MD5 690a3bf848afd4b4ab21abb3d8a383ff
BLAKE2b-256 3de7a784e076e54b60fdaace9c3c249f64af0abc9bbd602cf3825f34e78d1445

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyssabss-0.1.5-cp313-cp313-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.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for pyssabss-0.1.5-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0318402541a1f9eb674b071efa6b02bc3991e649e0e50ea9a9406c4bb6d33094
MD5 11871250cdbd6e8f483217f110c995eb
BLAKE2b-256 7d9f7db91b0dcd985a16b48d394d05afc0ed7229c9d57e488fcf4fa279983358

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for pyssabss-0.1.5-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 0992e73c8e0ac711b9bcb3585c5bcbee3ee82dec1a55a4672da75e8f6c2614ac
MD5 a86af9c3ddf3a36a2a759e8506bc4539
BLAKE2b-256 2ce7ab49b144798944c547935e53d816e60041763fc4dbdbac4a2bf2ac3666bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.5-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c1783af64899aa98874e45605af6797cdfbbf08f4f599f57c556fd9d21853cb6
MD5 477b324dd2d445705a0ab47ab9569ca3
BLAKE2b-256 41f6b1dc8ace4b6907382437ded8b1675dce01e82bcb90afd9b364b56e1c7d46

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for pyssabss-0.1.5-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 447b39125f43adf14c7f89627b988ae514f8e9b4545e6a3450da37b2aeafe7be
MD5 8d71ad146092d6f84c76870d0bc395f2
BLAKE2b-256 46d3b8b8182928e01026c55702efaeabe92f1b92f1eb2ed18aa99fd314cbbb1f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.5-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2afa5745116cfa3e7a2132ccfed2cbf7b5e27f19ef42e1312f199088c1bd1f78
MD5 4f375810b901600d72d06c38504666e8
BLAKE2b-256 a32b8b81acf87fd111b79cc785c680cc90d37325def262d5ee438f6876db81ad

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for pyssabss-0.1.5-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 98de7376362d798ea0f222098c575379ffaa2b512bfceaf790d3d84da46c1a12
MD5 5008d995cfd636af424305b9a50d8693
BLAKE2b-256 d002c684a3d2e51187f9f87c0d207f41b735655a7e2fff4f3a9fe9e37aad81ea

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.5-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4c5461d0e8a35deae8b112892808dac15993040cc3c9c410e458dfd8556eb956
MD5 6cdbc2f9e29a5a84da826a90b2a863bc
BLAKE2b-256 127d107b0b1e5375d70ccd6b0c23ab244444a0dab7860db16c7fa2c2b2900bb2

See more details on using hashes here.

Provenance

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

File metadata

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

File hashes

Hashes for pyssabss-0.1.5-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 1ad476e00576969a6b49c9682e197780111e06ade51b1e28664946a655685d0a
MD5 53f61d07b9dac0097f658843b0919739
BLAKE2b-256 03aa20af063934e3082c55fffc2ccf32722efcecec4873f6826e93fa301b790c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.5-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 871ffb431421140db997c6fcbe210b42ec6718be73157fbf41f2d44209d31b02
MD5 f1b4737fc343bb59398575d24b1c4aba
BLAKE2b-256 2ed823d1ec859ffd50fc470e5a9ace745e865f3428b8991b1c2b49c9ac0aedd8

See more details on using hashes here.

Provenance

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