Abstract
Longitudinal binary or count functional data are common in neuroscience, but are often too large to analyze with existing functional regression methods. We propose one-step penalized generalized estimating equations that supports continuous, count, or binary functional outcomes and is fast even when datasets have a large number of clusters and large cluster sizes. The method applies to both functional and scalar covariates, and the one-step estimation framework enables efficient smoothing parameter selection, bootstrapping, and joint confidence interval construction. Importantly, this semi-parametric approach yields coefficient confidence intervals that are provably valid asymptotically even under working correlation misspecification. By developing a general theory for adaptive one-step M-estimation, we prove that the coefficient estimates are asymptotically normal and as efficient as the fully-iterated estimator; we verify these theoretical properties in extensive simulations. Finally, we apply our method to a calcium imaging dataset published in Nature, and show that it reveals important timing effects obscured in previous non-functional analyses. In doing so, we demonstrate scaling to common neuroscience dataset sizes: the one-step estimator fits to a dataset with 150,000 (binary) functional outcomes, each observed at 120 functional domain points, in only ~ 13.5 minutes on a laptop without parallelization. We release our implementation in the fastFGEE package.
Keywords: functional data analysis, longitudinal data analysis, calcium imaging, generalized estimating equations, one-step estimators
Introduction
Neuroscience studies in animal models provide an invaluable tool to identify the neural mechanisms underpinning brain function and their relationship with psychiatric disorders. Researchers can estimate moment-by-moment associations between experimental covariates (e.g. behavior) and the activity of hundreds of neurons per animal, with widely-used in vivo brain recording techniques like calcium imaging (Grienberger et al., 2022) and Neuropixels (Jun et al., 2017). A neuroscientist might study brain-behavior associations on, for example, a learning task in which an animal learns to press a lever for a food reward. These tasks are often performed over hundreds of experimental replicates called “trials” (longitudinal observations akin to “patient visits”). Each trial might be defined as a five second interval starting at extension of the lever and ending with delivery of the food reward. To test whether, for example, mean neural activity is higher on trials when animals press the lever, a common strategy is to analyze scalar summaries of each trial’s neuronal firing activity. For instance, analysts might calculate a firing rate of neuron on trial by averaging the response, , across within-trial timepoints indexed by , where denotes a grid of timepoints at which the outcome is observed. One might then test whether , where is an indicator that the animal on which neuron was recorded pressed the lever on trial . This analysis approach is parsimonious but discards important temporal information by summarizing across trial timepoints, .
Alternatively, the neural response of each five second trial can be conceptualized as a functional outcome, with within-trial timepoints, , representing locations along the functional domain. This allows one to apply functional data analysis (FDA, Crainiceanu et al. (2024)) techniques to test how brain–behavior relationships evolve within and across trials (Loewinger et al., 2025). FDA offers a flexible framework to analyze a wide range of neuroscience studies, as it allows both the responses and the covariates (e.g. behavior) to be functional. The size and complexity of our dataset, however, require specialized FDA methods. First, analyses must account for the longitudinal structure, since each neuron’s activity is collected across many trials. Second, the large number of clusters (i.e. neurons) and large cluster sizes (i.e. number of trials recorded for a given neuron), often in the hundreds or thousands, make many longitudinal FDA methods for binary or count functional outcomes computationally impractical.
To conduct inference in longitudinal FDA with large datasets, we propose a one-step estimator for functional generalized estimating equations (fGEE). Procedurally, we first fit a function-on-scalar regression with a working independence correlation structure to obtain a consistent but potentially inefficient initial estimate of the functional coefficients. We then update the initial estimate with one Newton-Raphson update step, derived from an estimating equation that models intra-cluster correlation. This approach can scale to large datasets and has desirable statistical properties. The initial estimate can be formed quickly because it ignores correlation; using only ‘one step’ in the update is fast because it greatly reduces the number of times potentially large working covariance matrices are inverted. Importantly, our approach still captures much of the statistical efficiency afforded by modeling intra-cluster correlation in longitudinal and/or functional directions with a fully-iterated fGEE. In fact, we prove the one-step fGEE is asymptotically as efficient as the fully-iterated version.
We provide an implementation that supports functional data observed on regular, irregular, dense and sparse grids with functional and/or scalar covariates (see Appendix A.4 for implementation details and Section 7 for links to our Github repos). We further propose adoption of working correlation structures that allow for use of algorithms to efficiently construct and invert large working covariance matrices. We also propose fast strategies for smoothing parameter tuning, cluster bootstrapping, and joint confidence interval construction. We review the literature in Section 1, present our estimator in Section 2, provide theoretical results in Section 3, simulations in Section 4, and a data application in Section 5.
1. Related Literature
We focus on the longitudinal function-on-scalar regression literature, where a wide range of conditional and marginal methods have been proposed (Eckardt et al., 2024; Sergazinov et al., 2023; Zhu et al., 2019; Scheipl et al., 2016; Shou et al., 2015; Brockhaus et al., 2015; Scheipl et al., 2015; Zipunnikov et al., 2014; Greven et al., 2011; Morris and Carroll, 2006; Guo, 2002).
Functional mixed models are a versatile conditional strategy for longitudinal FDA. For non-Gaussian functional outcomes, many existing approaches do not scale well to large cluster sizes or cluster numbers; see discussion and comparison in Cui et al. (2022). Cui et al. (2022); Loewinger et al. (2025); Zhou et al. (2025) proposed a fast functional mixed models approach based on univariate mixed models fits at each functional domain point. These rely on a cluster bootstrap for inference, however, which can be slow for large datasets. Moreover, for non-Gaussian outcomes these approaches yield coefficient estimates that are only interpretable as conditional on the random effects. In many applications, estimates with marginal interpretations are desirable.
Functional GEE and Quadratic Inference Functions (QIF) are marginal methods for longitudinal function-on-scalar regression. Qu and Li (2005) and Guha Niyogi and Zhong (2025) proposed QIF-based methods applicable to FDA, but, to the best of our understanding, these works focused on a single observation of a functional outcome per subject. Chen et al. (2013) proposed a penalized GEE for longitudinal FDA that serves as part of the inspiration for our work. The method, however, requires inverting an matrix at each step of model fitting, where is the size of cluster , and is the number of points in the functional domain. Li et al. (2022) proposed a marginal estimator for continuous outcomes, but as we show in simulations, it does not scale to large cluster sizes, and has not been extended to binary or count outcomes. Taken together, marginal approaches for longitudinal functional regression with binary or count outcomes do not scale well, thereby limiting their widespread adoption.
Finally, there is a rich literature on penalized longitudinal marginal models for high dimensional covariates with sparsity; see Xia and Shojaie (2024) and references therein. However, we focus on functional data with low dimensional covariates where we do not encourage sparsity.
2. Methods
We begin by introducing notation, adopting that used in Li et al. (2022) where possible. We suppose that we observe the functional outcome at point for cluster , at longitudinal observation (e.g. trial or visit) . We express grids as regular (i.e. ) and evenly spaced for ease of notation, but our methods also apply to irregular and unevenly spaced grids. We denote as the functional outcome vector at point for cluster , concatenating all observations for , and write . We denote covariate vector for cluster on observation , and . We write covariates as scalar for ease of notation, though our method and theory applies to functional covariates.
2.1. Functional Generalized Estimating Equations
We consider the marginal function-on-scalar regression
| (1) |
where is a link function and is a (smooth) coefficient function for covariate . We let denote the mean function. We now discuss estimation of with spline basis expansions of the , although our methods can be used for other basis functions. For example, denoting as a set of B-spline basis functions, we can represent the functional coefficients . We denote as an unknown parameter vector associated with covariate , , and the linear predictor for a full observation of the functional outcome as . We further define , where . We then have that , where . Thus, we can estimate the functional coefficient vector, , by estimating and calculating .
We semi-parametrically estimate the with the penalized spline-based fGEE proposed in Chen et al. (2013). This assumes no likelihood and, if is correctly specified, yields valid inference for even if is misspecified. Specifically, the mean model parameters are estimated as the root of the penalized estimating equation
| (2) |
where is the working covariance matrix for cluster (whose true covariance matrix is ), , and . The pre-specified penalty matrix, , is associated with the diagonal matrix of smoothing parameters . Although no likelihood is adopted, the estimating equation (2) can be derived from the score equations from, for example, an exponential dispersion family (Liang and Zeger, 1986); we add the penalty term for improved estimation in finite samples. Compared to a working independence matrix , the estimation of can be made more efficient and accurate by exploiting correlation, in both functional and longitudinal directions, by choosing the working covariance matrix to estimate . Although such choices for in this fGEE model yield desirable statistical properties for longitudinal FDA, estimation is computationally intensive: estimating based on equation (2) requires inversion of the covariance matrix for each cluster , at each step in an optimization procedure.
2.2. One-step fGEE
To scale fGEE to large datasets, we propose a one-step estimator of the form
| (3) |
where is an initial estimate fit with smoothing parameters . We estimate (3) as
| (4) |
where we plug in to calculate , and , with applied component-wise. The updated estimate for the functional coefficient of covariate is then obtained as . Any consistent estimator for can be used for ; we use (2) with a working independence correlation structure, i.e., a function-on-scalar regression that ignores within-cluster correlation of outcome values across and , and uses the same penalty and spline bases as the fGEE. In practice, we estimate with the pffr function (Scheipl et al., 2015) from the refund package (see Appendix A.3 for details). We formalize the necessary consistency properties of for the population parameter, in Section 3.
The one-step can be conceptualized as a de-biasing of, or equivalently a single Newton-Raphson step from, the initial estimate . It is much faster than the fully-iterated fGEE, because it requires inversion of a working covariance matrix only twice per cluster: 1) to estimate , and 2) to estimate (see Section 2.5).
2.3. Working Correlations
Although fGEE yields valid inference regardless of the structure used (under correct mean model specification), the statistical and computational efficiency of fGEE depends heavily on the form adopted. Our one-step estimator is often far faster than the fully-iterated fGEE in Chen et al. (2013) but, if is large, it still may not scale. We therefore focus on parametric forms of that can be inverted quickly. We show in simulations below that these forms of can still yield the gains in statistical efficiency provided by more flexible specifications. Our theory and implementation neveretheless apply to a one-step with general forms of .
Parametric Correlation Structures
For scalability, we focus on adoption of a block working covariance matrix: , where models 1 However, when is large, even calculating at one point is computationally intensive with standard linear algebra routines. Luckily, exchangeable and AR1 working covariance matrices can be inverted efficiently. For example, rewriting , where and models , the inverse of with exchangeable structure has the analytical form (Lipsitz et al., 2017)
where is a vector of ones, and is the intra-cluster correlation coefficient.
If has the AR1 structure can be efficiently computed because, for , its decomposition yields a Toeplitz . For an estimated , we can quickly calculate by solving the Toeplitz system with, for example, the generalized Schur algorithm (Ammar and Gragg, 1988). This is done without fully constructing the matrix . When data are observed irregularly, one can use the algorithm proposed in Allévius (2018).
Correlation parameters
When adopting the block exchangeable or AR1 correlation structures, each is a function of a nuisance correlation parameter . We estimate these at each point separately and then optionally smooth over the functional domain to reduce variability. Defining residuals as , we use the method of moments estimator for the exchangeable structure (Molenberghs et al., 2005): , and truncate the at or if they fall outside the (−1, 1) range. For an AR1 structure, we estimate each with the Yule-Walker equations (Yule, 1927; Walker, 1931) when the longitudinal observations are sampled at regular time intervals. If sampled irregularly, we estimate with the MLE estimator proposed in Allévius (2018). We then calculate and truncate the at 0 or if they fall outside the [0, 1) range. The are calculated twice in our framework: 1) first using to calculate that is plugged into the one-step estimator (3), and 2) second using to calculate that is plugged into the estimator (see expression (6)).
2.4. Tuning
To calculate an initial estimate of , we select the smoothing parameters, denoted as , with fast restricted maximum likelihood (Wood, 2011). We found, however, that calculating the one-step estimate with the same values (i.e. ) tends to produce inaccurate coefficient estimates. Therefore, we propose to tune the smoothing parameters for the one-step, denoted as , based on the cross-validated prediction performance of the one-step estimator. In our simulations, K-fold cluster cross-validation (CV) produced one-step estimates with better estimation accuracy than one-step estimates based on smoothing parameters selected with GCV2 or the bootstrap-based procedure proposed in Chen et al. (2013). We use the negative log-likelihood as a CV fit criteria. We propose the following scalable CV for large datasets.
We define the folds, , as a disjoint partition of cluster index sets (i.e. the held-out cluster indices) where, for for each , and for all . To scale CV to large datasets, we exploit four features of the problem structure. First, each fold’s one-step estimate is calculated with pre-computable quantities. For example, rewriting the update as
illustrates that we can pre-compute each cluster’s , and . Second, we only need to estimate once. We can then use that , calculated on the full sample, as the initial estimate for all folds and values. This is because any consistent initial estimate, , is sufficient to ensure that the one-step estimator of a given fold is consistent for the population . This strategy may be unnecessary for datasets where fold-specific initial estimates can be calculated quickly. Third, assuming , we can (heuristically, by Slutsky’s theorem) calculate consistent one-step estimates in fold as
| (5) |
where . By using the full sample estimate , we only need to invert this matrix once for each value of , instead of inverting a fold-specific matrix for each unique pair. The strategy of keeping and fixed across folds is motivated by an analogous strategy for cluster bootstrapping of unpenalized one-step GEE (see Remark and Theorem 3.3 in Cheng et al. (2013)). Specifically, Cheng et al. (2013) showed that a cluster bootstrap that fixes these two quantities (at the full-sample estimates) across replicates enjoys the same theoretical guarantees asymptotically as an approach that re-estimates these quantities in each replicate-specific sample. In our simulations, our adaptation of this strategy for cluster CV was often dramatically faster than, and performed nearly identically to, a CV strategy that calculates using the fold-specific estimate . Fourth, we avoid tuning over a large grid of values by using a sequential CV procedure (see Appendix A.1 for details). We found these strategies performed well with in our simulations and data application.
2.5. Coefficient Estimator Variance
2.5.1. Sandwich Variance Estimator
We estimate the variance of our one-step estimator using the sandwich form
| (6) |
where , and , and denotes the sample average of a given function . We estimate via , i.e., by plugging in , and .
2.5.2. Fast Cluster Bootstrap Variance Estimator
Motivated by theory for cluster bootstrapping in non-functional one-step GEE (Cheng et al., 2013), we propose a fast cluster bootstrap as an alternative method to estimate , or to construct non-parametric bootstrap-based joint CIs. Namely, for bootstrap replicate,
| (7) |
where is a set of cluster indices of size , sampled with replacement, and . We estimate as the sample covariance matrix of the bootstrap replicates. Since equation (7) uses the same initial estimate and keeps the matrix fixed for all , this bootstrapping procedure typically takes less than a second for moderately sized . We show in simulations that coverage is comparable between CIs constructed with sandwich and fast bootstrap variance estimators (see Appendix Table 20).
2.6. Confidence Intervals
For fixed basis matrix , where () is a block diagonal matrix, with in each block. An asymptotically valid -level pointwise CI is given by , where , and is diagonal entry of .
We adapt parametric and non-parametric bootstrap based strategies described in Degras (2017) to construct -level joint CIs. Briefly, we calculate these at point as , where we estimate as the empirical quantile of statistics calculated on a bootstrap sample, , drawn from the sampling distribution of . For the parametric approach, we sample , with denoting the submatrix of associated with covariate . For the non-parametric approach, we calculate with our fast cluster bootstrap. We then set , where denotes element-wise division, and estimate as the empirical quantile of . Estimating based on draws of , instead of draws of , is much faster as usually . We apply the parametric approach in results shown in the main text, but provide simulation results in Appendix C.4 that show the non-parametric strategy achieves similar joint coverage.
3. Theory
For a fixed sequence with , let be the solution to the population estimating equation , where has components denoted for , and let . We define , and . Note that implicit to these definitions, and to the ensuing theory, is that we treat the working covariance matrices as fixed or computed with the “true” limiting correlation parameters throughout. In practice, we can replace these with their estimated counterparts under the assumption that for all , for some limiting parameters —see Corollary 1 of Chen et al. (2013).
Theorem 3.1. Suppose that the one-step estimators, and , are constructed using initial estimate, , and that the following conditions hold:
The inverse link function is three times continuously differentiable.
The covariates and outcomes have bounded support, i.e. such that for all , and , for all and .
.
, and .
, and .
.
Then the one-step estimator satisfies , where .
Condition (i) is a mild smoothness condition that holds for all standard link functions (e.g. logit, log). Condition (ii) is also standard—we expect it holds across essentially all biomedical settings. Note that it could be replaced by weaker moments conditions on the estimating equation, and its derivatives. Condition (iii) is a sufficient condition for the estimating equation to be asymptotically normal and implies that is invertible for all . Condition (iv) also states that the , and its sample analogue, are invertible for all . Condition (v) should hold when the limiting (unpenalized) estimating equation results in full rank limiting and . This should hold when the design matrices, , are full rank. Finally condition (vi) is a statement about the rate of convergence of the initial estimator. In practice, when the is estimated using a penalized unweighted estimating equation, this implies some conditions on the rates of convergence of the smoothing parameter values, and . We provide an expanded discussion of this in Appendix B, where we also develop a more general result for adaptive one-step M-estimation that may be of independent interest.
Remark 3.2. Our result shows that the one-step is asymptotically equivalent to the fully-iterated fGEE. Moreover, our result extends to non-linear link functions, while existing fGEE theory is restricted to the linear case (Chen et al., 2013). In the linear case, the one-step shares the same properties as those characterized in Chen et al. (2013), such as the convergence rates in small knot and large knot regimes in terms of the smoothing parameter, . We provide a lengthier discussion of the convergence rates of the coefficient estimates in terms of the smoothing parameters in Appendix B.
4. Simulations
We conducted simulations to assess 95% CI coverage, coefficient estimate accuracy, and algorithm timing. We report results from simulation replicates. We fit function-on-scalar regressions using penalized B-splines with 10 knots per functional coefficient. For both simulations, we set , , and . Denoting as functional coefficient for simulation replicate as point , we report estimation accuracy as . Denoting as the pointwise CI for replicate for functional coefficient at point , we report the average empirical pointwise coverage as: . Denoting the joint CI as , we report empirical joint coverage as: . In simulation 1, we generated continuous data to allow comparison with existing methods and a penalized Generalized Least Squares (GLS), which is similar to the fully-iterated fGEE. We show that the one-step with the pointwise working correlation structure, that we adopted for scalability, yields gains in statistical efficiency, and performs as well or better (in finite samples) than a method that adopts the true correlation structure in both longitudinal and functional directions. In simulation 2, we verify the one-step’s performance in a binary outcome setting. We include additional simulations in Appendix Section C.1.
4.1. Simulation 1: Gaussian Outcome with Exchangeable Correlation
We first tested one-step performance in a setting where the outcome was simulated to be correlated in both longitudinal and functional directions (i.e. for and, ). Thus this experiment also tests how the one-step performs when the pointwise longitudinal correlation structure we adopt is misspecified (i.e. it ignores the underlying correlation in the functional direction). Specifically, we simulated the outcome with an exchangeable correlation structure, allowing for comparison with the marginal decomposition (“Marginal”) approach proposed in Li et al. (2022), which models both within- and between-functional observation correlation. To provide a fair comparison with the Marginal approach, we based these synthetic data experiments on their marginal decomposition simulation scheme and code. We simulated data with the model
| (8) |
where , , and . Based on simulations in Li et al. (2022), we drew , and , where , with . We set parameters as in Li et al. (2022): where the orthonormal functions and , , , and . We show results from simulations with different parameters in Appendix C.2.
In addition to the Marginal approach, we compared the one-step to three benchmarks: 1) a penalized GLS with an independence working correlation structure (GLS-Ind), 2) a GLS with an exchangeable correlation structure (GLS-Ex), and 3) the initial function-on-scalar regression (FoSR), . We constructed CIs with a sandwich variance estimator for all methods, using the corresponding independence or exchangeable forms. Benchmark 1) shows how our implementation and tuning scheme performs without exploiting intra-cluster correlation, benchmark 2) shows performance of an estimator similar to a fully-iterated version of the one-step fGEE (using the same exchangeable correlation structure), and benchmark 3) shows the performance of a FoSR that ignores intra-cluster correlation. CIs for the FoSR fit should, however, achieve nominal coverage in this correlated setting, given that we use a sandwich variance estimator. See Appendix Sections A.2 and A.3 for further details on benchmarks 1–3. When analyzing continuous data in practice, the closed-form penalized GLS (e.g. GLS-Ex) is fast to calculate and is thus preferable to the one-step. However, we assess one-step performance in the continuous data setting because the availability of a closed-form estimator allows us to test how our one-step fGEE performs relative to a method similar to a fully-iterated fGEE.
Table 1 shows that the one-step coefficient accuracy is almost identical to the GLS-Ex, suggesting the one-step performs comparably to a fully-iterated fGEE. Moreover, the one-step performs as well or better than the Marginal estimator in Li et al. (2022). Thus, in these simulations, modeling at each point across values of , is enough to capture efficiency gains, even though the data were simulated such that , for . Table 2 shows that the pointwise coverage of the one-step is at roughly the nominal levels. In contrast, the Marginal grows highly anti-conservative for large , a feature acknowledged in Li et al. (2022). GLS-Ind tends to be slightly conservative, while FoSR is slightly anti-conservative at smaller sample sizes. Table 3 shows that the joint CIs3 are somewhat conservative for every method, although less so for FoSR. Together these simulations provide one example of how the correlation structure adopted here for computational reasons can still yields gains in statistical efficiency, even when compared to methods that model correlation in both longitudinal and functional directions.
Table 1:
Functional Coefficient Estimation Performance (RMSE) of each method relative to the FoSR fit (). Outcomes are simulated as Gaussian with exchangeable correlation. Cells contain the average of 300 replicates ± SEM (SEM= 0.00 indicates a value < 0.01). We indicate out-of-memory (30Gb) with symbol —.
| One-step | GLS-Ex | GLS-Ind | Marginal | ||
|---|---|---|---|---|---|
| 25 | 5 | 0.95 ± 0.01 | 0.95 ± 0.01 | 0.99 ± 0.00 | 0.96 ± 0.01 |
| 25 | 0.97 ± 0.01 | 0.97 ± 0.01 | 1.00 ± 0.00 | 1.01 ± 0.01 | |
| 100 | 1.00 ± 0.00 | 1.00 ± 0.00 | 1.01 ± 0.00 | 1.02 ± 0.01 | |
| 50 | 5 | 0.94 ± 0.01 | 0.94 ± 0.01 | 0.99 ± 0.00 | 0.95 ± 0.01 |
| 25 | 0.97 ± 0.00 | 0.97 ± 0.00 | 1.00 ± 0.00 | 0.99 ± 0.01 | |
| 100 | 0.99 ± 0.00 | 0.99 ± 0.00 | 1.00 ± 0.00 | 1.04 ± 0.01 | |
| 100 | 5 | 0.94 ± 0.01 | 0.94 ± 0.01 | 0.99 ± 0.00 | 0.93 ± 0.01 |
| 25 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.01 | |
| 100 | 0.99 ± 0.00 | 0.99 ± 0.00 | 1.00 ± 0.00 | — |
Table 2:
Pointwise 95% CI coverage. Cells contain the average of 300 replicates ± SEM (SEM= 0.00 indicates a value < 0.01). We indicate out-of-memory (30Gb) with symbol —.
| One-step | GLS-Ex | GLS-Ind | Marginal | FoSR | ||
|---|---|---|---|---|---|---|
| 25 | 5 | 0.92 ± 0.00 | 0.96 ± 0.00 | 0.96 ± 0.00 | 0.94 ± 0.00 | 0.90 ± 0.00 |
| 25 | 0.92 ± 0.00 | 0.95 ± 0.00 | 0.96 ± 0.00 | 0.94 ± 0.00 | 0.92 ± 0.00 | |
| 100 | 0.94 ± 0.00 | 0.97 ± 0.00 | 0.96 ± 0.00 | 0.71 ± 0.00 | 0.93 ± 0.00 | |
| 50 | 5 | 0.95 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.94 ± 0.00 | 0.91 ± 0.00 |
| 25 | 0.95 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.95 ± 0.00 | 0.94 ± 0.00 | |
| 100 | 0.94 ± 0.00 | 0.96 ± 0.00 | 0.97 ± 0.00 | 0.70 ± 0.00 | 0.93 ± 0.00 | |
| 100 | 5 | 0.96 ± 0.00 | 0.98 ± 0.00 | 0.97 ± 0.00 | 0.95 ± 0.00 | 0.92 ± 0.00 |
| 25 | 0.96 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.95 ± 0.00 | 0.94 ± 0.00 | |
| 100 | 0.96 ± 0.00 | 0.97 ± 0.00 | 0.98 ± 0.00 | — | 0.95 ± 0.00 |
Table 3:
Joint 95% CI coverage for Gaussian data simulated with exchangeable correlation. Each cell contains the average of 300 replicates ± SEM (SEM= 0.00 indicates a value < 0.01).
| One-step | GLS-Ex | GLS-Ind | FoSR | ||
|---|---|---|---|---|---|
| 25 | 5 | 0.97 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | 0.95 ± 0.00 |
| 25 | 0.97 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.97 ± 0.00 | |
| 100 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.97 ± 0.00 | |
| 50 | 5 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.94 ± 0.00 |
| 25 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | |
| 100 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.97 ± 0.00 | |
| 100 | 5 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.96 ± 0.00 |
| 25 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | |
| 100 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 |
These simulations also illustrate the scalability of the one-step. Table 4 shows that the one-step scales well with both and . In contrast, the Marginal approach is too memory-intensive to fit larger datasets and fit-times scale super-linearly as a function of and . Appendix A.1.3 has tables comparing performance of the one-step fit with a tuned using the “fast K-fold” and “K-fold” CV strategies. The fast K-fold CV approach yields similar performance, often in a fraction of the time. Tables in Appendix C.3 show that one-step 95% CIs achieve similar coverage, and take similar time to calculate, when constructed with sandwich or fast cluster bootstrap estimators. Finally, we show in Appendix C.4 that Joint CIs constructed with parametric and fast non-parametric bootstrap strategies achieve similar coverage. Taken together, our strategies for working correlation matrix inversion, smoothing parameter tuning, bootstrapping, and joint CI construction yield fast and accurate results.
Table 4:
Fit Time ± SEM (seconds) of each method. Outcomes are simulated as Gaussian with exchangeable correlation. We indicate out-of-memory (30Gb) with symbol —.
| One-step | GLS-Ex | GLS-Ind | Marginal | FoSR | ||
|---|---|---|---|---|---|---|
| 25 | 5 | 20.66 ± 0.14 | 9.05 ± 0.07 | 8.05 ± 0.04 | 0.49 ± 0.00 | 0.16 ± 0.00 |
| 25 | 23.24 ± 0.10 | 11.98 ± 0.04 | 11.99 ± 0.05 | 4.85 ± 0.03 | 0.27 ± 0.00 | |
| 100 | 54.87 ± 0.59 | 35.85 ± 0.55 | 35.03 ± 0.54 | 75.15 ± 1.07 | 1.17 ± 0.01 | |
| 50 | 5 | 27.45 ± 0.18 | 16.00 ± 0.13 | 14.60 ± 0.11 | 1.15 ± 0.01 | 0.21 ± 0.00 |
| 25 | 34.59 ± 0.14 | 21.37 ± 0.10 | 19.97 ± 0.13 | 29.79 ± 0.27 | 0.45 ± 0.00 | |
| 100 | 86.76 ± 1.05 | 64.70 ± 0.51 | 66.35 ± 0.63 | 415.64 ± 2.57 | 2.15 ± 0.01 | |
| 100 | 5 | 39.33 ± 0.21 | 27.26 ± 0.13 | 26.51 ± 0.14 | 3.79 ± 0.03 | 0.31 ± 0.00 |
| 25 | 73.25 ± 0.90 | 54.20 ± 0.73 | 51.83 ± 0.74 | 233.72 ± 1.69 | 1.08 ± 0.02 | |
| 100 | 146.26 ± 2.27 | 102.88 ± 1.43 | 87.89 ± 0.99 | — | 2.79 ± 0.01 |
4.2. Simulation 2: Binary Outcome with AR1 Correlation
We simulated correlated binary data with the SimCorMultRes package (Touloumis, 2016) with functional observations observed on an evenly spaced grid. The mean model was
| (9) |
where , and denotes the standard normal density function. The covariates were drawn as described in Section 4.1. The covariance matrix was set as , where . We used the AR1 structure for .
Table 5 shows that the one-step improves coefficient estimation performance relative to the initial FoSR fit, , particularly when and/or is large. Tables 6 and 7 show our approach improves CI coverage relative to FoSR. The one-step coverage hovers around 0.9 (pointwise) and 0.98 (joint). In contrast, the FoSR CI coverage is poor, particularly when both and are large. This is unexpected as we use a sandwich variance estimator to construct FoSR CIs (calculated with an independence working correlation), so we expected that they would achieve nominal coverage. Thus, while fitting a FoSR with working independence and using a sandwich estimator for inference may seem like a fast, viable alternative to fGEE (with a working correlation other than independence), it can yield CIs with poor coverage. Finally, the fit times, shown in Table 8, demonstrate the scalability of the one-step estimator.
Table 5:
Functional Coefficient Estimation Performance (RMSE) relative to the FoSR fit . Each cell contains the average of 300 replicates ± SEM (SEM= 0.00 indicates a value < 0.01). Table values below 1.0 indicate the one-step has more accurate coefficient estimates. Outcomes are simulated as binary with AR1 correlation coefficient .
| 0.25 | 0.5 | 0.75 | ||
|---|---|---|---|---|
| 25 | 5 | 1.03 ± 0.01 | 1.02 ± 0.01 | 0.98 ± 0.01 |
| 25 | 1.01 ± 0.01 | 0.99 ± 0.01 | 0.91 ± 0.01 | |
| 100 | 0.99 ± 0.00 | 0.97 ± 0.00 | 0.91 ± 0.01 | |
| 50 | 5 | 1.02 ± 0.00 | 1.01 ± 0.01 | 0.98 ± 0.01 |
| 25 | 1.00 ± 0.00 | 0.96 ± 0.00 | 0.90 ± 0.01 | |
| 100 | 0.98 ± 0.00 | 0.96 ± 0.00 | 0.91 ± 0.01 | |
| 100 | 5 | 1.01 ± 0.00 | 1.00 ± 0.01 | 0.97 ± 0.01 |
| 25 | 0.99 ± 0.00 | 0.97 ± 0.00 | 0.92 ± 0.01 | |
| 100 | 0.99 ± 0.00 | 0.97 ± 0.00 | 0.93 ± 0.00 |
Table 6:
Functional Coefficient Pointwise 95% CI Coverage comparing FoSR with the one-step. Each cell contains the average of 300 replicates ± SEM (SEM= 0.00 indicates a value <0.01). Outcomes are simulated as binary with AR1 correlation coefficient .
| One-step | FoSR | ||||||
|---|---|---|---|---|---|---|---|
| 0.25 | 0.5 | 0.75 | 0.25 | 0.5 | 0.75 | ||
| 25 | 5 | 0.89 ± 0.00 | 0.89 ± 0.00 | 0.88 ± 0.00 | 0.94 ± 0.00 | 0.90 ± 0.00 | 0.84 ± 0.00 |
| 25 | 0.89 ± 0.00 | 0.89 ± 0.00 | 0.89 ± 0.00 | 0.92 ± 0.00 | 0.87 ± 0.00 | 0.75 ± 0.00 | |
| 100 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.91 ± 0.00 | 0.85 ± 0.00 | 0.72 ± 0.00 | |
| 50 | 5 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.93 ± 0.00 | 0.90 ± 0.00 | 0.84 ± 0.00 |
| 25 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.92 ± 0.00 | 0.86 ± 0.00 | 0.74 ± 0.00 | |
| 100 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.84 ± 0.00 | 0.71 ± 0.00 | |
| 100 | 5 | 0.92 ± 0.00 | 0.92 ± 0.00 | 0.92 ± 0.00 | 0.94 ± 0.00 | 0.90 ± 0.00 | 0.84 ± 0.00 |
| 25 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.91 ± 0.00 | 0.86 ± 0.00 | 0.74 ± 0.00 | |
| 100 | 0.89 ± 0.00 | 0.90 ± 0.00 | 0.90 ± 0.00 | 0.88 ± 0.00 | 0.82 ± 0.00 | 0.69 ± 0.00 | |
Table 7:
Functional Coefficient Joint 95% CI Coverage comparing FoSR with the one-step. Each cell contains the average of 300 replicates ± SEM (SEM= 0.00 indicates a value < 0.01). Outcomes are simulated as binary with AR1 correlation coefficient .
| One-step | FoSR | ||||||
|---|---|---|---|---|---|---|---|
| 0.25 | 0.5 | 0.75 | 0.25 | 0.5 | 0.75 | ||
| 25 | 5 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | 0.95 ± 0.00 |
| 25 | 0.98 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.99 ± 0.00 | 0.97 ± 0.00 | 0.90 ± 0.00 | |
| 100 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.97 ± 0.00 | 0.98 ± 0.00 | 0.96 ± 0.00 | 0.88 ± 0.00 | |
| 50 | 5 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | 0.95 ± 0.00 |
| 25 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.97 ± 0.00 | 0.90 ± 0.00 | |
| 100 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.96 ± 0.00 | 0.87 ± 0.00 | |
| 100 | 5 | 0.99 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.99 ± 0.00 | 0.98 ± 0.00 | 0.95 ± 0.00 |
| 25 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.98 ± 0.00 | 0.96 ± 0.00 | 0.89 ± 0.00 | |
| 100 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.97 ± 0.00 | 0.95 ± 0.00 | 0.86 ± 0.00 | |
Table 8:
Fit Time ±SEM (seconds) for the entire one-step estimation procedure. Outcomes are simulated as binary with AR1 correlation coefficient .
| 0.25 | 0.5 | 0.75 | ||
|---|---|---|---|---|
| 25 | 5 | 20.78 ± 0.11 | 19.97 ± 0.17 | 19.01 ± 0.06 |
| 25 | 26.69 ± 0.23 | 25.07 ± 0.23 | 23.45 ± 0.09 | |
| 100 | 49.67 ± 0.64 | 67.62 ± 0.50 | 46.37 ± 0.36 | |
| 50 | 5 | 29.64 ± 0.11 | 29.27 ± 0.09 | 29.34 ± 0.10 |
| 25 | 43.93 ± 0.25 | 39.98 ± 0.22 | 39.71 ± 0.20 | |
| 100 | 111.59 ± 1.42 | 98.36 ± 1.22 | 96.62 ± 1.02 | |
| 100 | 5 | 49.28 ± 0.12 | 49.78 ± 0.17 | 49.33 ± 0.13 |
| 25 | 73.97 ± 0.52 | 77.71 ± 0.70 | 73.89 ± 0.47 | |
| 100 | 212.35 ± 3.29 | 222.63 ± 2.92 | 170.01 ± 1.48 |
5. Application
We apply our framework to calcium imaging data to illustrate the benefits of longitudinal FDA in analyzing neural recordings. To motivate our approach, we first describe common analysis strategies. There is a rich methodological literature on analyzing neuronal firing data to, for example, identify spike times (Jewell and Witten, 2018), denoise data (Pnevmatikakis et al., 2016), identify network connections (Wang et al., 2025), and model interactions between neurons with dynamical systems (Glaser et al., 2020). These analysis approaches have different goals and we do not review them here due to space constraints. Instead we focus on what we have observed are common strategies among experimentalists for hypothesis testing of covariate-neural activity associations, as they have similar goals to our proposed method. These approaches seem to vary largely in how 1) the target neural population is defined, 2) the longitudinal structure is accounted for, and 3) the trial-level neural time-series are modeled.
Since calcium imaging and electrophysiology record the activity of many neurons, and recordings are collected in several animals, analyses differ in how the target population is defined and the nesting of neurons within animal is modeled. For example, the neural pseudo-population strategy, as we refer to it, fits a single model to a dataset that pools neurons across animals (e.g. see Figures 1, 3, and 3 of Willmore et al. (2023); Zhang et al. (2023); Roesch et al. (2009), respectively). This conceptualizes neurons, both within and across animals, as exchangeable given covariates and model parameters. The animal-specific neural population strategy, as we refer to it, summarizes the collection of neurons separately in each animal, and then summarizes the animal-specific statistics with a secondary pooled test statistic (e.g. see Figs 2H in (Legaria et al., 2022), Fig 1G, 1I in Inácio et al. (2025)). The animal-level summary is usually a model fit to, or an average of, the activity of all neurons recorded from that animal (e.g. see Figs 2G in (Legaria et al., 2022)). This ignores uncertainty in the animal-level statistics when estimating a pooled test statistic. A third approach estimates a test statistic on data from each neuron separately and then fits a model to those statistics (e.g. see Figures 1K, 2E-H of Inácio et al. (2025)). The pooled test ignores uncertainty in the neuron-level statistics, and models the neuron-level statistics estimated on data from neurons in the same animal as independent.
Analysis strategies differ in how the longitudinal structure of experiments are modeled. One strategy is to treat the neural responses of cluster — however defined — as exchangeable across trials given model parameters (e.g. see Figure 3E of Jeong et al. (2022) for an example from photometry). A second strategy averages the response across trials and analyzes those trial-averaged measures (e.g. see Figure 2 of Coddington et al. (2023)). This discards longitudinal information. A third strategy accounts for the longitudinal structure with random effects Loewinger et al. (2025), yielding conditional estimates in binary outcome settings.
Analyses vary in how the densely-sampled neural time-series of each trial is conceptualized. Arguably, the most common strategy analyzes univariate summaries of the time-series (e.g. a trial firing rate for each neuron and trial ) pooled across animals and/or trials (e.g. see Figures 1, 3, and 3 of Willmore et al. (2023); Zhang et al. (2023); Roesch et al. (2009), respectively). This strategy can obscure behavior–brain associations and substantially change scientific conclusions because it discards timing information about how covariate-outcome relationships evolve across trial timepoints (Loewinger et al., 2025). A second strategy is to retain the time-series structure, but model covariate-neural activity associations as constant across trial timepoints for each neuron. For example, Inácio et al. (2025) has the goal of identifying neurons associated with a particular behavior over time (e.g. see Figures 1–2). To that effect, they fit a Pearson correlation between behavior and neural activity in each cell separately. This is comparable to the linear regression (e.g. see figure 1K in Inácio et al. (2025)). This models the covariate–outcome relationship as constant across trial timepoints. A third strategy proposed in (Loewinger et al., 2025) addresses this by modeling each trial as a functional outcome. They demonstrate this strategy on fiber photometry data, a recording technique that yields a single neural signal per animal. It would be desirable to apply longitudinal FDA strategies to other recording techniques, such as calcium imaging or electrophysiology data. This has not been done, to our knowledge, and we believe this is primarily due to the fact that those modalities record potentially tens of thousands of signals per animal, and existing approaches may not scale.
Figure 1:
Functional coefficient estimates for Independent (Ind), Exchangeable (Exch), and Auto-regressive-1 (AR1) working correlation structures.
To address these limitations, we apply our fGEE on a dataset that pools neurons across animals (akin to the “neural pseudo-population” strategy). This accounts for the 1) longitudinal and 2) functional nature of the response in each cluster (i.e.neuron), and 3) does not discard uncertainty in the animal-specific estimates in providing an overall neural pseudo population-level estimate. This implicitly assumes a covariance structure where correlation between neurons within-animal is negligible. In some cases, it may be preferable to apply a fGEE to the neurons in each animal separately (i.e. the animal-specific neural population strategy). This would allow for functional coefficients to differ across animals, but necessitates an approach to construct a pooled estimate of animal-level fits that propagates uncertainty.
5.1. Application Background
We apply our method on data from a recent Nature paper studying the role of pyramidal neurons in the primary somatosensory cortex (S1) in behavior and sensory input (Inácio et al., 2025). This study recorded neuronal activity in five mice, from 155 – 262 (mean± SEM: 184.4 ± 22.61) neurons per animal. Recording was done in head-fixed animals, running on a ball that tracked their movement speed. The authors were interested in identifying S1 neurons active during spontaneous movements. They tested whether each S1 neuron was associated with running speed, whisker movement, and whisker sensory input.
5.2. Identifying neural activity encoding speed information
The correlation analysis used in the original paper could only test the neural activity–speed association on average within trials. In contrast, an FDA approach can test how this association evolves across trial timepoints. To demonstrate that, we randomly sampled neurons (clusters) from the five animals, and identified five second intervals when animals spontaneously began to run. The start of this running burst was considered a “trial” (experimental replicate) initiation as typically analyzed in neuroscience. Thus the functional outcome for neuron , on trial was a binary timeseries vector across five seconds of neural activity measured at 30Hz (starting at the beginning of the running bout to 5 sec after running initiation). This results in a functional outcome measured at an evenly spaced grid of points. Speed, was defined as a functional covariate and took the same value for all neurons recorded from the same animal. The cluster size was for all neurons . We fit the model
with three possible working correlation structures: independence, exchangeable and AR1. For working independence, we applied the sandwich estimator to the initial FoSR fit, .
The independence and exchangeable correlations structures yielded similar results and showed a significant effect only briefly around 3–4 seconds (see Figure 1a). The estimated exchangeable correlation parameter for all , and thus the exchangeable and working independence fits were similar. In contrast, the AR1 model showed a much wider time-interval during which effects were significant. This model also had larger estimates. The AR1 structure is a common correlation structure to adopt in timeseries analysis of neuroscience, and seems more appropriate given that successive trials are recorded close together in time.
The most salient finding was that, even with the AR1 model, the speed–neural activity association does not become significant until about one second after the animals begin to run and that association becomes non-significant fairly quickly. The timing of the association suggests that these neurons are not driving the movement of the animal. This shows how the timing sensitivity of fGEE can help identify the type of cognition or behavior a brain region encodes, which is much harder to do with analyses of trial summary measures.
5.3. Whisker Stimulation
The authors of the original paper were also interested in how neural activity in S1 neurons changed as a result of whisker stimulation. The summary analyses they carried out only allowed estimation of the extent to which whisker stimulation changed neural activity on average across within-trial timepoints. To characterize the “temporal dynamics” of the neural response to this manipulation, and demonstrate the scalability of the one-step, we applied our method to activity from randomly selected neurons (clusters), each with observations of the functional outcome: 4 sec of neural activity, measured 1 sec before whisker stimulation to 3 sec after . We fit the following model
where is an indicator that neuron was recorded from an animal that was stimulated on trial . We fit the model with the same working correlation structures as above.
The one-step estimator, fit to 150,000 functional observations, took ~13.38 min to fit on a MacBook Pro with an Apple M1 Max chip with 64GB of RAM, without parallelization, and maintained a reasonable memory footprint throughout. The coefficient associated with stimulation, , shows the estimated mean difference in neural activity between stimulated and non-stimulated trials. It appears stimulation leads to a rapid reduction in activity that lasts about two sec (see Figure 1b). The estimated exchangeable correlation parameter for all , and thus the exchangeable and working independence fits are identical. This analysis illustrates how the one-step makes it possible to identify a clear temporal profile for the effect of interest, and is scalable enough to allow estimation over a large sample of neurons.
In Appendix D, we conduct an additional analysis on this same dataset to examine the association between whisker activity and neural activity. The results reveal that the association between whisker activity and neural activity is significant throughout the trial.
6. Discussion
The proposed one-step fGEE can be applied and extended in a range of related settings. For example, only minor adjustments are needed to extend our code to implement an fGEE using a qausi-likelihood based on other distributions (e.g. gamma, beta). In addition to the scalable working covariance forms focused on here, our implementation can also be applied with working covariances, , that are estimated more flexibly (e.g. using FPCA). Finally, it should be straightforward to extend our method and code to multivariate functional domains, as well as longitudinal scalar-on-function and function-on-function regressions; we believe parameters from these methods can be estimated through estimating equations with similar forms to the fGEE equations used here. We hope our theoretical guarantees and efficient implementation encourage analysts to apply FDA methods in neuroscience and other settings.
7. Software and Reproducibility
Our application and simulation code is in the Github repo: https://github.com/gloewing/fgee_onestep. The development version of the fastFGEE package in R can be found in the Github repo: https://github.com/gloewing/fastFGEE.
Supplementary Material
Acknowledgments
This research was supported by the Intramural Research Program of the National Institute of Mental Health (NIMH), project ZIC-MH002968. This study utilized the high-performance computational capabilities of the Biowulf Linux cluster at the National Institutes of Health, Bethesda, MD (http://biowulf.nih.gov). We thank Dr. Soohyun Lee for allowing us to use her lab’s data in our data application, Dr. Yuan Zhao for advice and help with data pre-processing, Dr. Emily Hector for helpful initial conversations about the method, and Dr. Keith Goldfeld for allowing us to use his package as a starting point for our implementation.
Footnotes
Our implementation also allows for modeling covariance in the functional direction (instead of modeling covariance in the longitudinal direction) by adopting an alternative block diagonal correlation structure that specifies and for and .
Restricted Maximum Likelihood cannot be used to select smoothing parameters for fGEE because there is no likelihood to maximize (Chen et al., 2013).
The Marginal approach does not provide code for joint CIs.
References
- Allévius B. (2018). On the precision matrix of an irregularly sampled ar(1) process.
- Ammar G. S. and Gragg W. B. (1988). Superfast solution of real positive definite toeplitz systems. SIAM Journal on Matrix Analysis and Applications, 9(1):61–76. [Google Scholar]
- Barrett T., Dowle M., Srinivasan A., Gorecki J., Chirico M., Hocking T., Schwendinger B., and Krylov I. (2025). data.table: Extension of ‘data.frame’. R package version 1.17.99, https://Rdatatable.gitlab.io/data.table, https://github.com/Rdatatable/data.table.
- Brockhaus S., Scheipl F., Hothorn T., and Greven S. (2015). The functional linear array model. Statistical Modelling, 15(3):279–300. [Google Scholar]
- Chen H., Wang Y., Paik M. C., and Choi H. A. (2013). A marginal approach to reduced-rank penalized spline smoothing with application to multilevel functional data. Journal of the American Statistical Association, 108(504):1216–1229. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Cheng G., Yu Z., and Huang J. Z. (2013). The cluster bootstrap consistency in generalized estimating equations. Journal of Multivariate Analysis, 115:33–47. [Google Scholar]
- Coddington L. T., Lindo S. E., and Dudman J. T. (2023). Mesolimbic dopamine adapts the rate of learning from action. Nature, 614(7947):294–302. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Crainiceanu C. M., Goldsmith J., Leroux A., and Cui E. (2024). Functional data analysis with R. CRC Press. [Google Scholar]
- Cui E., Leroux A., Smirnova E., and Crainiceanu C. M. (2022). Fast univariate inference for longitudinal functional models. Journal of Computational and Graphical Statistics, 31(1):219–230. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Degras D. (2017). Simultaneous confidence bands for the mean of functional data. WIREs Computational Statistics, 9(3):e1397. [Google Scholar]
- Eckardt M., Mateu J., and Greven S. (2024). Generalized functional additive mixed models with (functional) compositional covariates for areal covid-19 incidence curves. Journal of the Royal Statistical Society Series C: Applied Statistics, 73(4):880–901. [Google Scholar]
- Glaser J., Whiteway M., Cunningham J. P., Paninski L., and Linderman S. (2020). Recurrent switching dynamical systems models for multiple interacting neural populations. In Larochelle H., Ranzato M., Hadsell R., Balcan M., and Lin H., editors, Advances in Neural Information Processing Systems, volume 33, pages 14867–14878. Curran Associates, Inc. [Google Scholar]
- Goldsmith J., Scheipl F., Huang L., Wrobel J., Di C., Gellar J., Harezlak J., McLean M. W., Swihart B., Xiao L., Crainiceanu C., Reiss P. T., and Cui E. (2024). refund regression with functional data. R package version 0.1–37.
- Greven S., Crainiceanu C., Caffo B., and Reich D. (2011). Longitudinal functional principal component analysis. In Recent advances in functional data analysis and related topics, pages 149–154. Springer. [Google Scholar]
- Grienberger C., Giovannucci A., Zeiger W., and Portera-Cailliau C. (2022). Two-photon calcium imaging of neuronal activity. Nature Reviews Methods Primers, 2(1):67. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Guha Niyogi P. and Zhong P.-S. (2025). Quadratic inference with dense functional responses. Journal of Multivariate Analysis, 207:105400. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Guo W. (2002). Functional mixed effects models. Biometrics, 58(1):121–128. [DOI] [PubMed] [Google Scholar]
- Inácio A. R., Lam K. C., Zhao Y., Pereira F., Gerfen C. R., and Lee S. (2025). Brain-wide presynaptic networks of functionally distinct cortical neurons. Nature. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jeong H., Taylor A., Floeder J. R., Lohmann M., Mihalas S., Wu B., Zhou M., Burke D. A., and Namboodiri V. M. K. (2022). Mesolimbic dopamine release conveys causal associations. Science, 378(6626):eabq6740. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jewell S. and Witten D. (2018). Exact spike train inference via l0 optimization. The annals of applied statistics, 12(4):2457. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Jun J. J., Steinmetz N. A., Siegle J. H., Denman D. J., Bauza M., Barbarits B., Lee A. K., Anastassiou C. A., Andrei A., Aydın Ç., Barbic M., Blanche T. J., Bonin V., Couto J., Dutta B., Gratiy S. L., Gutnisky D. A., Häusser M., Karsh B., Ledochowitsch P., Lopez C. M., Mitelut C., Musa S., Okun M., Pachitariu M., Putzeys J., Rich P. D., Rossant C., Sun W. l., Svoboda K., Carandini M., Harris K. D., Koch C., O’Keefe J., and Harris T. D. (2017). Fully integrated silicon probes for high-density recording of neural activity. Nature, 551(7679):232–236. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Kuschnig N. (2023). sanic: Solving Ax = b Nimbly in C++. R package version 0.0.2.
- Legaria A. A., Matikainen-Ankney B. A., Yang B., Ahanonu B., Licholai J. A., Parker J. G., and Kravitz A. V. (2022). Fiber photometry in striatum reflects primarily nonsomatic changes in calcium. Nature Neuroscience, 25(9):1124–1128. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Li R., Xiao L., Smirnova E., Cui E., Leroux A., and Crainiceanu C. M. (2022). Fixed-effects inference and tests of correlation for longitudinal functional data. Statistics in Medicine, 41(17):3349–3364. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Liang K.-Y. and Zeger S. L. (1986). Longitudinal data analysis using generalized linear models. Biometrika, 73(1):13–22. [Google Scholar]
- Ling Y. and Lysy M. (2022). SuperGauss: Superfast Likelihood Inference for Stationary Gaussian Time Series. R package version 2.0.3.
- Lipsitz S., Fitzmaurice G., Sinha D., Hevelone N., Hu J., and Nguyen L. L. (2017). One-step generalized estimating equations with large cluster sizes. Journal of Computational and Graphical Statistics, 26(3):734–737. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Loewinger G., Cui E., Lovinger D., and Pereira F. (2025). A statistical framework for analysis of trial-level temporal dynamics in fiber photometry experiments. Elife, 13:RP95802. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Molenberghs G., Verbeke G., et al. (2005). Models for discrete longitudinal data.
- Morris J. S. and Carroll R. J. (2006). Wavelet-based functional mixed models. Journal of the Royal Statistical Society Series B: Statistical Methodology, 68(2):179–199. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Papadakis M., Tsagris M., Dimitriadis M., Fafalios S., Tsamardinos I., Fasiolo M., Borboudakis G., Burkardt J., Zou C., and Lakiotaki K. (2018). Package ‘rfast’.
- Pnevmatikakis E. A., Soudry D., Gao Y., Machado T. A., Merel J., Pfau D., Reardon T., Mu Y., Lacefield C., Yang W., et al. (2016). Simultaneous denoising, deconvolution, and demixing of calcium imaging data. Neuron, 89(2):285–299. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Qu A. and Li R. (2005). Quadratic inference functions for varying-coefficient models with longitudinal data. Biometrics, 62(2):379–391. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Roesch M. R., Singh T., Brown P. L., Mullins S. E., and Schoenbaum G. (2009). Ventral striatal neurons encode the value of the chosen action in rats deciding between differently delayed or sized rewards. Journal of Neuroscience, 29(42):13365–13376. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Scheipl F., Gertheiss J., and Greven S. (2016). Generalized functional additive mixed models. Electronic Journal of Statistics. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Scheipl F., Staicu A.-M., and Greven S. (2015). Functional additive mixed models. Journal of Computational and Graphical Statistics, 24(2):477–501. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Sergazinov R., Leroux A., Cui E., Crainiceanu C., Aurora R. N., Punjabi N. M., and Gaynanova I. (2023). A case study of glucose levels during sleep using multilevel fast function on scalar regression inference. Biometrics, 79(4):3873–3882. [DOI] [PubMed] [Google Scholar]
- Shou H., Zipunnikov V., Crainiceanu C. M., and Greven S. (2015). Structured functional principal component analysis. Biometrics, 71(1):247–257. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Touloumis A. (2016). Simulating correlated binary and multinomial responses under marginal model specification: The simcormultres package. The R Journal, 8:79–91. https://rjournal.github.io/. [Google Scholar]
- Venables W. N. and Ripley B. D. (2002). Modern Applied Statistics with S. Springer, New York, fourth edition. ISBN 0-387-95457-0. [Google Scholar]
- Walker G. T. (1931). On periodicity in series of related terms. Proceedings of the Royal Society of London. Series A, Containing Papers of a Mathematical and Physical Character, 131(818):518–532. [Google Scholar]
- Wang X., Kolar M., and and A. S. (2025). Statistical inference for networks of high-dimensional point processes. Journal of the American Statistical Association, 120(550):1014–1024. [Google Scholar]
- Willmore L., Minerva A. R., Engelhard B., Murugan M., McMannon B., Oak N., Thiberge S. Y., Peña C. J., and Witten I. B. (2023). Overlapping representations of food and social stimuli in mouse vta dopamine neurons. Neuron, 111(22):3541–3553.e8. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Wood S. N. (2011). Fast stable restricted maximum likelihood and marginal likelihood estimation of semiparametric generalized linear models. Journal of the Royal Statistical Society Series B: Statistical Methodology, 73(1):3–36. [Google Scholar]
- Wood S. N. (2017). Generalized Additive Models: An Introduction with R. Chapman and Hall/CRC, 2 edition. [Google Scholar]
- Xia L. and Shojaie A. (2024). Inference for linear functionals of high-dimensional longitudinal proteomics data using generalized estimating equations.
- Yule G. U. (1927). Vii. on a method of investigating periodicities disturbed series, with special reference to wolfer’s sunspot numbers. Philosophical Transactions of the Royal Society of London. Series A, Containing Papers of a Mathematical or Physical Character, 226(636–646):267–298. [Google Scholar]
- Zhang Y., Rózsa M., Liang Y., Bushey D., Wei Z., Zheng J., Reep D., Broussard G. J., Tsang A., Tsegaye G., Narayan S., Obara C. J., Lim J.-X., Patel R., Zhang R., Ahrens M. B., Turner G. C., Wang S. S. H., Korff W. L., Schreiter E. R., Svoboda K., Hasseman J. P., Kolb I., and Looger L. L. (2023). Fast and sensitive gcamp calcium indicators for imaging neural populations. Nature, 615(7954):884–891. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Zhou X., Cui E., Sartini J., and Crainiceanu C. (2025). Prediction inference using generalized functional mixed effects models. arXiv preprint arXiv:2501.07842. [Google Scholar]
- Zhu H., Chen K., Luo X., Yuan Y., and Wang J.-L. (2019). Fmem: Functional mixed effects models for longitudinal functional responses. Statistica Sinica, 29(4):2007. [DOI] [PMC free article] [PubMed] [Google Scholar]
- Zipunnikov V., Greven S., Shou H., Caffo B., Reich D. S., and Crainiceanu C. (2014). Longitudinal high-dimensional principal components analysis with application to diffusion tensor imaging of multiple sclerosis. The annals of applied statistics, 8(4):2175. [DOI] [PMC free article] [PubMed] [Google Scholar]
Associated Data
This section collects any data citations, data availability statements, or supplementary materials included in this article.

