Overview

Contents

Overview#

spm1d v0.5 conducts classical hypothesis testing on one-dimensional continuum data that have been registered to a common domain. If you have measured multiple continua (or “trajectories”, “waveforms”, “time series”, etc.) AND if you can register those continua to a common domain (e.g., “time normalize”) then you can conduct analyses using spm1d.

As a general rule of thumb: if you can validly calculate a mean continuum (i.e., mean trajectory or mean waveform) and also a standard deviation continuum, then you can also validly use spm1d to conduct statistical tests.

spm1d procedures are divided into two main steps: (1) test statistic calculation, and (2) statistical inference. The test statistic (usually t-value or F-value) is calculated at each domain point. If your data have \(Q\)=101 domain points, then the test statistic will be a 101-point continuum. The test statistic, like the sample mean and sample standard deviation, may be regarded as a feature of your specific dataset.

In contrast, statistical inference pertains to the infinite set of test statistic continua that would emerge from an infinite number of identical experiments when there is no true effect. When the underlying data vary smoothly over the domain, so too does each test statistic continuum that emerges from that smooth noise process. From the perspective of classical hypothesis testing, the most important probability is the survival function \(P(z_{max}> u)\) ; the probability that the continuum maximum \(z_{max}\) exceeds height \(u\). If one sets that probability to \(\alpha\) (usually \(\alpha\)=0.05), then \(u\) is the critical value above which only 100\(\alpha\)% of \(z_{max}\) values would traverse when there is truly no effect; this critical value of \(u\) is denoted \(z_c\) in spm1d ; thus \(P(z_{max}> z_c) = \alpha\) .

By default, spm1d calculates the critical threshold \(z_c\) and several other probabilistic quantities parametrically using random field theory (RFT). In addition to RFT, spm1d offers two similar procedures: permutation (a nonparametric procedure identical to the “Fmax” procedure from the functional data analysis literature) and false discovery rate (FDR) control. RFT is used by default because:

  • RFT is a parametric procedure that is much faster than permutation.

  • RFT controls the false positive rate (FPR) so its probabilities are more directly related to classical hypothesis testing than FDR’s.

Nevertheless, each inference procedure has its own strengths and weaknesses. All users are encouraged to review spm1d’s inference options when selecting an inference procedure.


Data array shape#

All data must be submitted to spm1d procedures as numpy arrays. The required array shape depends on the data type.

Data type

Shape

Example interpretation

Univariate 0D

(J,)

20 scalars (e.g., body mass of 20 individuals)

Univariate 1D

(J, Q)

20 trials × 101 domain points (e.g., 20 measurements of knee flexion angle)

Multivariate 0D

(J, I)

20 measurements × 5 components (e.g., 20 maximum activity values for each of 5 muscles)

Multivariate 1D

(J, Q, I)

20 trials × 101 domain points × 3 components (e.g., 20 measurements of 3-component reaction force)

  • J: number of observations

  • Q : number of domain points

  • I : number of vector components

In all cases, the first dimension represents observations. Interpretations of the second and third dimensions depend on the data type.

It may appear that the required array shapes for Univariate 1D (J,Q) and Multivariate 0D (J,I) are indistinguishable from each other. Usually Q is relatively large (often Q=100 or 101) and usually I is relatively small (often I=2 or 3 and usually less than 10), but there is a more important disambiguation route: the procedures in spm1d.stats are classified as univariate vs. multivariate:

  • A univariate procedure like spm1d.stats.ttest2 will regard (J,) data as univariate 0D and (J,Q) data as univariate 1D, regardless of the actual sizes of J and Q.

  • A multivariate procedure like spm1d.stats.hotellings2 will regard (J,I) data as multivariate 0D and (J,Q,I) data as multivariate 1D, regardless of the actual sizes of J, Q and I.