Skip to main content

The Fourier-Schur transform for spatial statistics.

Project description

(prerelease)

Overview

Fourier-Schur analysis is an analogue of Fourier analysis in which the time domain and corresponding cyclic symmetry are replaced by the spatial joint moment tensor domain and permutation symmetry (or, equivalently, linear spatial symmetry). It is used to derive natural higher-order statistics for “registered” spatial datasets.

The transform works by decomposing the generalized covariance tensor of several random variables into canonical components. The “sectors” (irreducible subrepresentations) defining these components in tensor space are defined a priori by the condition that they are mutually unreachable from each other by arbitrary change-of-coordinate transformations, as part of a rich theory going back to the work of Issai Schur and Hermann Weyl.

The algorithm used here is described in A Schur Transform for Spatial Stochastic Processes. See also Persi Diaconis’ Group Representations in Probability and Statistics for background on the non-abelian Fourier transform in the context of the symmetric group.

Getting started

Install:

pip install schurtransform

Suppose that your data are stored in a multi-dimensional array data[i,j,a] (or similar list-of-list-of-lists), where

  • step index i ranges across n steps (e.g. time-steps, or random variables)

  • sample index j ranges cross N samples (e.g. number of trajectories or landmarks)

  • spatial index a ranges across k dimensions (e.g. k=3)

The following shows basic usage:

import schurtransform as st

data = [
    [[4,2], [4.01,2.1], [3.9,2.2]],
    [[3.99,2.1], [3.7,2.1] ,[4.0,2.2]],
    [[4.4,1.9], [4.3,1.8], [4.3,1.8]],
    [[4.6,2.0], [4.1,1.8], [4.3,1.7]],
]
decomposition = st.transform(
    samples=data,
)
print(list(decomposition.keys()))
print(decomposition['3+1'].data)

This outputs:

['1+1+1+1', '2+1+1', '2+2', '3+1', '4']

[[[[ 0.00000000e+00  4.44722222e-05]
   [ 3.48055556e-05 -3.82222222e-05]]

  [[ 2.09166667e-05  6.05555556e-05]
   [ 1.22222222e-05 -4.38888889e-05]]]


 [[[-1.00194444e-04 -1.22222222e-05]
   [-6.05555556e-05 -6.83333333e-05]]

  [[ 3.82222222e-05  5.61111111e-05]
   [ 5.61111111e-05  0.00000000e+00]]]]

The components are the GL(k)- or Sn-isotypic components of the covariance tensor of data in the tensor space with n tensor factors and k dimensions for each factor. Each one is presented as a multi-dimensional numpy array with n indices ranging across k values.

The library ships with the character tables up to S8. For more than 8-fold statistics, see generate_characters/ for information about using GAP to generate additional character tables.

Example

demo.py is a more extensive usage example. It calculates the Schur content (many Schur transforms for various subsets of the series index) of a lung deformation as measured by a 4D CT scan. Data available for download from DIR-lab.

![alttext](combo_dirlab_sc.png)

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

schurtransform-0.1.39.tar.gz (39.6 kB view hashes)

Uploaded Source

Built Distribution

schurtransform-0.1.39-py3-none-any.whl (49.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page