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

Uploaded CPython 3.13Windows x86-64

pyssabss-0.1.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl (122.6 kB view details)

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

pyssabss-0.1.3-cp312-cp312-win_amd64.whl (117.4 kB view details)

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.11Windows x86-64

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

Uploaded CPython 3.10Windows x86-64

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

Uploaded CPython 3.9Windows x86-64

pyssabss-0.1.3-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.3.tar.gz.

File metadata

  • Download URL: pyssabss-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 6e0fcfaa93a6da841e372d32e66d4b296d219e5935b81a236c3aa2fd7240702a
MD5 bc06a6e9d0c8b0a159c0938fbe8a5091
BLAKE2b-256 c96d7ffc6914aced70afcb0e3ea7226cd66ee207ec70a559d4aa0e6154a3453a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.3-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 117.4 kB
  • Tags: CPython 3.13, 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.3-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 fbdec81f5e2d7fb8c6532fefedac713a6db20fd7e5ca38e7602409881f249249
MD5 895e337686f12dea176815586978ffb2
BLAKE2b-256 49966e07dd0c552eb993e9eea2e63db8879eab2dffbc99b1c0643550dc94eb3e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.3-cp313-cp313-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dec6863902ad81f75980c74c2cc5866974935413fb85f5f0f14641e4e345286c
MD5 45911e785459c93ae0dd5f5282663cbb
BLAKE2b-256 93eca16d9ce58aad6c03dbbc5bcdf4bdab9edf455044edf85c97baaf20505730

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.3-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.3-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8c013e62aa3fba6c0f9b945762a3c2d9c004ca1c53e9ec180cf6822e6a5410c0
MD5 dcd95a7dd0a9e619a9387b9bcd9c1cd9
BLAKE2b-256 39caaeb8c7f0d9da2a75cdd9ff2bed7497fd6dcfd0e3c15f7f2f6d023bff0cd0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.3-cp312-cp312-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4d99d12d51c2e879fb89dbe4c8d8d8781b948fba7f2f2e5e90207cd23b6277ee
MD5 4aebd09310504553588750ac4cee4ab9
BLAKE2b-256 edd6e525b5dc9ee135bdeb438c1131b786cc6ad34a4d47bc40fb9fd201397e3d

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.3-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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 4002d25c2b86d77afd1f8823ed27b5ee3b58e35f442fdec40790f78c5641f3d6
MD5 79793cc888733a8102cdee832d5c85c4
BLAKE2b-256 3fdc3ea5fae0a6c9e1b86fff8d8b63fa7613e4f779363055cd5067935c911c44

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.3-cp311-cp311-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fcfb17d06704f5170f5a2a682ac0cca2a9cfddec5928bcb78d58a64b164b700a
MD5 8627fca8793b1719ee0a978a618433db
BLAKE2b-256 5efeb5ceae2d019cfd41c02c5a7f47ce66fe59de267d33e04e0bb1b216761302

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.3-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.3-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 cfe2b50dca281ed1b60edecc8310fbea39383aa68825abf03691f795136cf6ce
MD5 8fd90e4344c75246c9963fcd4a24a30a
BLAKE2b-256 8e80015a21b6b93d006d7c2212b72bc9c1e9ac82181798b35622ba9ead004c69

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.3-cp310-cp310-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c8af368773ca7e19b88562cd5f1551658f66120684bf20539fde0f5f9e2aae6
MD5 393eb83b1004b8f819bcd04cb208499b
BLAKE2b-256 d501994b1c24f3d988aa5b9959241da2ebe986e044d372db5be95f3113d1d64c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: pyssabss-0.1.3-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.3-cp39-cp39-win_amd64.whl
Algorithm Hash digest
SHA256 176be319ff314775ca8626213b80f69592cd7ba27ecfcd86d4392d1f533aecf5
MD5 1f8c3e441e18e6cb1dedb7338989b68f
BLAKE2b-256 627fa2d94e64129fb94fa4ac6566ec4317c84d499213cab618bbd51e5fc1c811

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for pyssabss-0.1.3-cp39-cp39-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 981877effb6dd510f5ecd1a8c9e6d6fe96449d651c1c66f33bbc8aae46b7c272
MD5 4b25b0dedecaeecc279559d6aa47cbe8
BLAKE2b-256 f51a056ba7b833176457083a08a931d107627668d47053655ad3bf0df2086fde

See more details on using hashes here.

Provenance

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