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

Uploaded CPython 3.13Windows x86-64

pyssabss-0.1.4-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.4-cp312-cp312-win_amd64.whl (126.2 kB view details)

Uploaded CPython 3.12Windows x86-64

pyssabss-0.1.4-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.4-cp311-cp311-win_amd64.whl (123.6 kB view details)

Uploaded CPython 3.11Windows x86-64

pyssabss-0.1.4-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.4-cp310-cp310-win_amd64.whl (123.0 kB view details)

Uploaded CPython 3.10Windows x86-64

pyssabss-0.1.4-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.4-cp39-cp39-win_amd64.whl (123.2 kB view details)

Uploaded CPython 3.9Windows x86-64

pyssabss-0.1.4-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.4.tar.gz.

File metadata

  • Download URL: pyssabss-0.1.4.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.4.tar.gz
Algorithm Hash digest
SHA256 534021362c397d56c0dccf60d7fdbe0e896c8dbb420b81164dac968b10e10d8b
MD5 f9f2351f3db42cb5429a6ea0de21c988
BLAKE2b-256 70521bdfb80be831e24f187668616f124279cc64320b7fa030db17facc25c9a8

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.4-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.4-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f993c179818e304b295546416c95fd062fc3e57ad04528af7b6d55ae36ecc677
MD5 7e7fc108d1e9f1a1439453205a6a6106
BLAKE2b-256 83045d77e19318cd03d7c3650a694a8d6de36f71bc61cf301394fec8f9d77852

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.4-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4678e5407fbb0415fc916e6fabcd814a86d7eeee62a9d6504a8f7b15febb6440
MD5 1992ae2fdde100ccbca958056ae8023a
BLAKE2b-256 8daf2585784e78979ca308d438de5a609af2dfa07ca00ad8a620abcceffcd4f2

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.4-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.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 f867bf3731e33b201d091e9029e9c1e41cd40c669d44fbe44c91fb933a34d12f
MD5 812a317fb29bba58ad4506e1c302541b
BLAKE2b-256 2c23abd9a01dc8b08d0c33efd262203d437ba16922a37f97a6182fd18bf0c8ec

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.4-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 bc5f406de76cd838ae1163cd58dacc4998287c93330f728ba9a3c7a813fe734e
MD5 02bff6ed5eb42e9655a0b6fe45d38a11
BLAKE2b-256 c14887aecf5098781af638a5d79ec2eb67ece07e026dbf4bed80d1d21044e188

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.4-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.4-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 da8123851c505fe22fb3e4b917d2e4e2a16eb0fa6c636c7173528ac1c1f26769
MD5 2a32db142421fccceef63935cfab523f
BLAKE2b-256 e5f6f9f7cff276e1cd9444f1eb3fcb07a1fb926b8b72e9cab48134e7b625ef4a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.4-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 04b451e0ce860ac83970ba598f2f128a5876ee9da95839ec9a31c1c0d409a459
MD5 07556f127af2e9027839d1cd22ac8d20
BLAKE2b-256 a1d7bd08a8b782cb0eeb7c50282b1513404122d9f2bede8909c4dd66345126b7

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.4-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.4-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 3b827a0c1978cfd1072c4187cffaae963a13194c7d4d3a10912f4cbdc65c9ed5
MD5 7fd9d8211b692d16f80a0361e0e016cd
BLAKE2b-256 755dcfed14c3ab88959af7dc947e904ba39f8f278d44c3b0c24982bf18cbb867

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.4-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c7dc5254083539d0d2019f72e5651e0d69f55bf86041691ecc22d38ed1e295b
MD5 80f42a7014a2e3bb58915a1a10685a27
BLAKE2b-256 651325ad9ccdebecebb18075a4fd50eda3f2774cff8a8d6f3e475ba65e77c04e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.4-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.4-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 69dd640bb72d9b66702241cff6b496d0f3aaec21b6b6481018b068f8f663c5cd
MD5 df4f5fa69aab228b159444554d0b7e22
BLAKE2b-256 e59a52ce5c53e9fdac57b9df312659b78555d7da4b0036302212d846cf7442bb

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.4-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 069402a04c4544f4d16f28c2e4fdb65052d896e0528a5a6cd279c3ee73833509
MD5 d7f2774991b2f1d037d1c086b104bb2d
BLAKE2b-256 1ad5c0e926f721e1729d072367067dc882577c7fbfd46c57849ab0eb21c0d52e

See more details on using hashes here.

Provenance

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