Skip to main content

tsdr: Time-Series Dimension Reduction

About

Time-series dimension reduction (TSDR) methods are a class of algorithms for the dimension reduction of multivariate data that exploit temporal structure. In contrast to general dimension reduction (GDR) methods, the outputs of which are invariant to temporal permutation, TSDR methods are sensitive to temporal structure.

The figure above visually summarises the categories of TSDR methods that we defined in Owens & Fulcher (2025). The first five categories (a-e) consist of methods that extract time-series components based on different aspects of temporal structure, i.e., slowness, autocorrelation, predictability, determinism, and non-stationarity. The final two categories (f-g) consist of methods that share a common methodology, i.e., diffusion-based and latent variable methods.

The tsdr package provides python implementations of TSDR methods from each of these seven categories. The methods are written in a simple, readable style to enable time-series analysts to better understand a subset of the TSDR methods discussed in the Owens & Fulcher (2025) review paper.

Acknowledgement :

If you use this software, please read and cite this open-access article:

Installation

Using pip for tsdr:

pip install tsdr

Usage

from tsdr.slowness import SFA

import numpy as np
import scipy
import matplotlib.pyplot as plt

# create a dataset for analysis
# a sinusoid
z = np.sin(np.linspace(0, 4*np.pi, 1000))
# multichannel noise
D = 10
noise = np.random.normal(scale=1.0, size=((len(z), D-1)))
# linear mixing
A = scipy.stats.ortho_group.rvs(D, random_state=1)
X = np.concatenate([z.reshape(-1,1), noise], axis=1) @ A

# extract a slow component using SFA
slow_component = SFA(n_components=1).fit_transform(X)

# visualise the component
fig, axs = plt.subplots(6, 1, figsize=(8, 8))
axs[0].plot(slow_component, lw=1.0)
axs[0].set_ylabel('SFA1')
for i in range(D):
    axs[i].spines[['right', 'top', 'bottom']].set_visible(False)
    axs[i].set_xticks([])
    axs[i+1].plot(X[:, i], c='black', linewidth=0.5)
    axs[i+1].set_ylabel(f'X{i+1}')
axs[D].spines[['right', 'top']].set_visible(False)
axs[D].set_xlabel('Time')
plt.tight_layout()

Metadata

Release files for tsdr 0.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for tsdr 0.4
File Size Uploaded
tsdr-0.4.tar.gz 21.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for tsdr 0.4
File Interpreter ABI Platform
tsdr-0.4-py3-none-any.whl Python 3 none any Details

Total release size: 48.6 kB

Release files / tsdr-0.4.tar.gz

Download URL tsdr-0.4.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
d68229dc896baab4591603deda533d7b577a5719a73eff2aeccccff217e98018
BLAKE2b-256 checksum
How to use checksums
172d0c90f08442ba2fb140b3d69751fd3ad62b6809b16d33fea4bf7a6097f181
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release files / tsdr-0.4-py3-none-any.whl

Download URL tsdr-0.4-py3-none-any.whl
Size 26.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f93d0f989d7e05065cae598cae0c3485442d3107f9ebba9ccafbe24fae6900bd
BLAKE2b-256 checksum
How to use checksums
89856a68bf2f5d4dd43101f0a813e37000a3ea5d4a9186c886687ecae539d8e6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.7

Release history Release notifications | RSS feed

0.5

2 release files

This release

0.4 This release

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page