Power1D: A Python toolbox for numerical power estimates in experiments involving one-dimensional continua

The unit of experimental measurement in a variety of scientific applications is the one-dimensional (1D) continuum: a dependent variable whose value is measured repeatedly, often at regular intervals, in time or space. A variety of software packages exist for computing continuum-level descriptive statistics and also for conducting continuum-level hypothesis testing, but very few offer power computing capabilities, where ‘power’ is the probability that an experiment will detect a true continuum signal given experimental noise. Moreover, no software package yet exists for arbitrary continuum-level signal / noise modeling. This paper describes a package called power1d which implements (a) two analytical 1D power solutions based on random field theory (RFT) and (b) a high-level framework for computational power analysis using arbitrary continuum-level signal / noise modeling. First power1d’s two RFT-based analytical solutions are numerically validated using its random continuum generators. Second arbitrary signal / noise modeling is demonstrated to show how power1d can be used for flexible modeling well beyond the assumptions of RFT-based analytical solutions. Its computational demands are non-excessive, requiring on the order of only 30 s to execute on standard desktop computers, but with approximate solutions available much more rapidly. Its broad signal / noise modeling capabilities along with relatively rapid computations imply that power1d may be a useful tool for guiding experimentation involving multiple measurements of similar 1D continua, and in particular to ensure that an adequate number of measurements is made to detect assumed continuum signals. ABSTRACT 9 The unit of experimental measurement in a variety of scientiﬁc applications is the one-dimensional (1D) continuum: a dependent variable whose value is measured repeatedly, often at regular intervals, in time or space. A variety of software packages exist for computing continuum-level descriptive statistics and also for conducting continuum-level hypothesis testing, but very few offer power computing capabilities, where ‘power’ is the probability that an experiment will detect a true continuum signal given experimental noise. Moreover, no software package yet exists for arbitrary continuum-level signal / noise modeling. This paper describes a package called power1d which implements (a) two analytical 1D power solutions based on random ﬁeld theory (RFT) and (b) a high-level framework for computational power analysis using arbitrary continuum-level signal / noise modeling. First power1d ’s two RFT-based analytical solutions are numerically validated using its random continuum generators. Second arbitrary signal / noise modeling is demonstrated to show how power1d can be used for ﬂexible modeling well beyond the assumptions of RFT-based analytical solutions. Its computational demands are non-excessive, requiring on the order of only 30 s to execute on standard desktop computers, but with approximate solutions available much more rapidly. Its broad signal / noise modeling capabilities along with relatively rapid computations imply that power1d may be a useful tool for guiding experimentation involving multiple measurements of similar 1D continua, and in particular to ensure that an adequate number of measurements is made to detect assumed continuum signals.


27
Analyzing multiple measurements of one-dimensional (1D) continua is common to a variety of scientific 28 applications ranging from annual temperature fluctuations in climatology ( Fig.1) to position trajectories 29 in robotics. These measurements can be denoted y(q) where y is the dependent variable, q specifies 30 continuum position, usually in space or time, and where the continua are sampled at Q discrete points. 31 For the climate data depicted in Fig.1 y is temperature, q is day and Q=365. 32 Measurements of y(q) are often: (i) registered and (ii) smooth. The data are 'registered' in the sense 33 that point q is homologous across multiple continuum measurements. Registration implies that it is 34 generally valid to compute mean and variance continua as estimators of central tendency and dispersion 35 (Friston et al., 1994). That is, at each point q the mean and variance values are computed, and these form 36 mean and variance continua (Fig.1b) which may be considered unbiased estimators of the true population 37 mean and variance continua. 38 The data are 'smooth' in the sense that continuum measurements usually exhibit low frequency signal. 39 This is often a physical consequence of the spatial or temporal process which y(q) represents. For example, 40 the Earth's rotation is slow enough that day-to-day temperature changes are typically much smaller than process. 48 The Canadian temperature dataset in Fig.1 exhibits both features. The data are naturally registered 49 because each measurement station has one measurement per day over Q=365 days. The data are smooth 50 because, despite relatively high-frequency day-to-day temperature changes, there are also comparatively 51 low-frequency changes over the full year and those low-frequency changes are presumably the signals of 52 interest. 53 Having computed mean and variance continua it is natural to ask probabilistic questions regarding 54 them, and two basic kinds of probability questions belong to the categories: (i) classical hypothesis testing  60 Classical hypothesis testing can be conducted at the continuum level using a variety of theoretical and 61 computational procedures. In the context of the temperature data ( Fig.1b) a natural hypothesis testing 62 question is: is there is a statistically significant difference between the Atlantic and Continental mean 63 temperature continua? Answering that question requires a theoretical or computational model of stochastic 64 continuum behavior so that probabilities pertaining to particular continuum differences can be calculated. the true continuum difference is null) would traverse in α percent of an infinite number of experiments, 82 where α is the Type I error rate and is usually 0.05.

83
Of the three thresholds depicted in Fig.2  and (b) is conventionally set at a power of 0.8, and that convention is followed below.

107
The literature describes two main analytical approaches to continuum-level power analysis: (i) inflated 108 variance (Friston et al., 1996)    Here Q is the continuum size, q is the continuum position at which the Gaussian pulse is centered, 149 fwhm is the full-width-at-half-maximum of the Gaussian kernel, and amp is its maximum value (Fig.4). The first command loads the Canadian temperature (or 'weather') data as a Python dictionary. The  The resulting test statistic continua are depicted in Fig.11. Since test statistic continua can be  Overall these results imply that, while the null hypothesis will be rejected with high power, it will 318 not always be rejected in the continuum region which contains the modeled signal (i.e., roughly between

Manuscript to be reviewed
Computer Science • The investigator must specify the scope of the hypothesis in an a priori manner (i.e. single point, 324 general region or whole-continuum) and use the appropriate power value (i.e. POI, COI or omnibus, 325 respectively).

326
The model depicted in Fig.12 is simple, and similar results could be obtained analytically by con- The results in Fig.13 depict the ROI as blue background window and suggest that the omnibus power is 368 close to 0.8. Setting the COI radius to the ROI radius of 50 via the set coi radius method emphasizes 369 that the COI power continuum's maximum is the same as the omnibus power. Also note that, had an ROI  Here s2 is the variance and f is the ratio of signal-to-noise smoothness. The probability of rejecting the 441 null hypothesis when the alternative is true is given as the probability that random fields with smoothness 442 W * will exceed the threshold u * (Wstar and ustar, respectively), and where that probability can be Here u is the critical threshold and nct sf is RFT's noncentral t survival function. The analytical power 487 is p=0.731. Next, similar to the 0D validation above, power1d can be used to validate this analytical 488 power by constructing signal and noise objects as indicated below. Note that the signal is Constant (Fig.5 Here the numerically estimated power is p=0.747, which is again similar to the analytical probability intermediate sample sizes (Fig.16c, J=25). Since theoretical and simulated results appear to diverge 508 predominantly for high powers these results suggest that the noncentral RFT approach is valid in scenarios 509 where powers of approximately 0.8 are sought for relatively small sample sizes.

510
While the noncentral RFT approach has addressed the low-power limitation of the inflated variance 511 method (Fig.15), its 'signal' is geometrically simple in the form of a mean shift. Clearly other, more 512 complex signal geometries may be desirable. For example, in the context of the Canadian temperature 513 data ( Fig.1)  The most comprehensive and user-friendly software package for computing power is G-power (Faul 527 et al., 2007). In addition to the standard offerings of noncentral t computations, G-power also offers 528 noncentral distributions for F, χ 2 and a variety of other test statistics. It has an intuitive graphical user 529 interface that is dedicated to power-specific questions. However, in the context of this paper G-power is 530 identical to common software packages in that its power calculations are limited to 0D (scalar) data.

531
Two software packages dedicated to continuum-level power assessments, and those most closely 532 related to power1d are: sense. This approach is computationally efficient but is still geometrically relatively simple. A second 545 limitation of both packages is that they do not support numerical simulation of random continua. This is 546 understandable because it is computationally infeasible to routinely simulate millions or even thousands 547 of the large-volume 3D and 4D random continua that are the target of those packages' power assessments.