| Title: | Fast Functional Generalized Estimating Equations via a One-Step Estimator |
|---|---|
| Description: | Fits functional generalized estimating equations for longitudinal functional outcomes and covariates using a one-step estimator that is fast even for large cluster sizes or large numbers of clusters. The package supports quasi-likelihoods derived from a range of distributions, with substantial simulations run for quasi-likelihoods derived from Gaussian, binomial, Poisson, negative binomial, Gamma and beta families. It supports common link functions and several working correlation structures. An optimized engine constructs cluster score and sensitivity statistics in one pass, provides coefficient-space Gaussian cross-validation, analytic-gradient fast cluster cross-validation, and an experimental sandwich-scaled working restricted quasi-likelihood selector. Internal compiled routines provide symmetric positive-definite Cholesky solves and exact tridiagonal precision operations for irregularly sampled continuous-time AR(1) working correlations. Uncertainty quantification is based on sandwich variance estimators and studentized wild cluster bootstrap procedures for cluster-robust pointwise intervals and optional simultaneous bands. The package implements methods described in Loewinger et al. (2025) <https://pmc.ncbi.nlm.nih.gov/articles/PMC12306803/>. |
| Authors: | Gabriel Loewinger [aut, cre] (ORCID: <https://orcid.org/0000-0002-0755-8520>) |
| Maintainer: | Gabriel Loewinger <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.2.2 |
| Built: | 2026-10-07 22:45:44 UTC |
| Source: | https://github.com/gloewing/fastFGEE |
A simulated dataset used in examples and testing for fastFGEE.
The object d is a data frame containing a functional response stored
in an AsIs matrix column together with a cluster identifier, two
scalar covariates, and a longitudinal time variable.
data(d)data(d)
A data frame with 5 variables:
YAn AsIs matrix-valued column containing the
functional response. In the included example, the matrix has 100 columns
named Y_1 to Y_100.
IDCluster identifier.
X1First scalar covariate.
X2Second scalar covariate.
timeLongitudinal time variable.
This dataset is intended for package examples, vignettes, and quick testing
of fgee. It represents a simulated binary-response setting on
a common functional grid.
Simulated for the package examples.
Fits longitudinal functional-response generalized estimating equations using the validated one-step estimator.
fgee( formula, data, cluster, family, corr_fn = "ar1", corr_long = "ar1", time = NULL, long.dir = TRUE, var.type = "sandwich", pffr.mod = NULL, knots = NULL, bs = "bs", cv = "fastkfold", cv.grid = NULL, rho.smooth = FALSE, rho.pool = c("fn", "none", "long", "both"), joint.CI = "wild", linpred_method = c("accumulate", "matrix"), clip_mu = 0, m.pffr = c(2, 1), check_alignment = TRUE, boot.samps = 3000, sp.method = c("auto", "fastk_staged", "fastk_grad", "fastk_grad_fast", "sandwich_qreml", "qreml_fastk"), working.retain = c("auto", "scores", "aggregate", "full"), corr.solver = c("auto", "exact", "supergauss"), fastk.K = 10L, fastk.seed = 1L, fastk.memory = c("balanced", "speed", "lowmem"), fastk.start = c("qreml", "robust", "compact"), fastk.kernel = fgee_fastk_kernel_ok(), qreml.phi.method = c("penalized", "all", "fixed"), qreml.phi.fixed = NULL, qreml.phi.weight = 1, qreml.phi.clip = c(1, 8), keep.tuning.workspace = FALSE, verbose.tuning = TRUE, keep.data = TRUE, keep.initial.fit = TRUE, keep.working.stats = TRUE, ... )fgee( formula, data, cluster, family, corr_fn = "ar1", corr_long = "ar1", time = NULL, long.dir = TRUE, var.type = "sandwich", pffr.mod = NULL, knots = NULL, bs = "bs", cv = "fastkfold", cv.grid = NULL, rho.smooth = FALSE, rho.pool = c("fn", "none", "long", "both"), joint.CI = "wild", linpred_method = c("accumulate", "matrix"), clip_mu = 0, m.pffr = c(2, 1), check_alignment = TRUE, boot.samps = 3000, sp.method = c("auto", "fastk_staged", "fastk_grad", "fastk_grad_fast", "sandwich_qreml", "qreml_fastk"), working.retain = c("auto", "scores", "aggregate", "full"), corr.solver = c("auto", "exact", "supergauss"), fastk.K = 10L, fastk.seed = 1L, fastk.memory = c("balanced", "speed", "lowmem"), fastk.start = c("qreml", "robust", "compact"), fastk.kernel = fgee_fastk_kernel_ok(), qreml.phi.method = c("penalized", "all", "fixed"), qreml.phi.fixed = NULL, qreml.phi.weight = 1, qreml.phi.clip = c(1, 8), keep.tuning.workspace = FALSE, verbose.tuning = TRUE, keep.data = TRUE, keep.initial.fit = TRUE, keep.working.stats = TRUE, ... )
formula |
A model formula whose left-hand side is a functional response. |
data |
A data frame containing the variables in |
cluster |
Name of the cluster identifier column. |
family |
A family object or family name understood by |
corr_fn |
Working correlation in the functional direction: |
corr_long |
Working correlation in the longitudinal direction: |
time |
Optional name of the longitudinal ordering variable. |
long.dir |
Logical retained for backwards compatibility. |
var.type |
Variance estimator: |
pffr.mod |
Optional fitted |
knots |
Number of spline knots for the initial |
bs |
Basis type passed to |
cv |
Cross-validation mode used for smoothing-parameter selection. The public one-step interface currently supports only |
cv.grid |
Optional grid or staged grids of smoothing parameters. |
rho.smooth |
Logical; smooth pointwise working-correlation estimates. |
rho.pool |
Controls pooling of the working-correlation parameter when only one direction is correlated. |
joint.CI |
Controls interval construction. |
linpred_method |
Method used to form linear predictors. |
clip_mu |
Lower bound used for numerical stabilization of fitted means. |
m.pffr |
Penalty-order specification passed to |
check_alignment |
Logical; check alignment between the wide data and the long representation produced by |
boot.samps |
Number of bootstrap replicates when applicable. |
sp.method |
Smoothing-parameter selector. |
working.retain |
Retention profile for compact working statistics: |
corr.solver |
Correlation inverse backend. |
fastk.K |
Number of cluster folds for optimized fastK tuning. |
fastk.seed |
Seed used to construct optimized fastK folds. |
fastk.memory |
Non-Gaussian fastK workspace. |
fastk.start |
Initialization strategy for analytic-gradient fastK. |
fastk.kernel |
Logical; allow the compiled loss/gradient kernel when supported. |
qreml.phi.method |
Information-scaling diagnostic used by sandwich qREML. |
qreml.phi.fixed |
Fixed information scale when |
qreml.phi.weight |
Weight applied to the information mismatch before clipping. |
qreml.phi.clip |
Lower and upper safeguards for the qREML information scale. |
keep.tuning.workspace |
Logical; retain large tuning workspaces for debugging. |
verbose.tuning |
Logical; print optimized tuning progress. |
keep.data |
Logical; retain long-format working data in the fitted object. |
keep.initial.fit |
Logical; retain the initial |
keep.working.stats |
Logical; retain compact initial and final working statistics. |
... |
Reserved to detect removed estimator controls. Unknown entries are rejected rather than silently ignored. |
Public calls always use one coefficient update and the optimized working-statistics engine. FastK selectors use the one-step fast cluster cross-validation construction; "sandwich_qreml" remains an explicit opt-in selector rather than a cross-validation method. Historical exact-GLS, legacy-engine, pffr-only, and fully iterated controls remain internal for regression testing and method development and are not accepted by fgee().
Pointwise intervals and simultaneous bands answer different inferential questions. A simultaneous band uses a whole-curve maximum statistic in the asymptotic or resampling procedure. Nominal finite-sample simultaneous coverage is not guaranteed, particularly with few or high-leverage independent clusters or unstable nuisance and correlation estimates.
An object of class "fgee1step". Important components include beta, vb, model, lambda, and tuning.
Loewinger, G., Levis, A. W., Cui, E., and Pereira, F. (2025). Fast Penalized Generalized Estimating Equations for Large Longitudinal Functional Datasets.
## Not run: data("d", package = "fastFGEE") fit <- fgee( Y ~ X1 + X2, data = d, cluster = "ID", family = binomial(link = "logit"), time = "time", corr_long = "exchangeable", corr_fn = "independent" ) fgee.plot(fit) ## End(Not run)## Not run: data("d", package = "fastFGEE") fit <- fgee( Y ~ X1 + X2, data = d, cluster = "ID", family = binomial(link = "logit"), time = "time", corr_long = "exchangeable", corr_fn = "independent" ) fgee.plot(fit) ## End(Not run)
fastFGEE modelProduces coefficient plots with pointwise intervals and optional simultaneous confidence bands when available. A displayed simultaneous band represents the fitted procedure's whole-curve calibration; it is not a guarantee of nominal finite-sample simultaneous coverage, especially with few independent clusters.
fgee.plot( fit, num_row = NULL, xlab = "Functional Domain", title_names = NULL, ylim = NULL, align_x = NULL, x_rescale = 1, y_val_lim = 1.1, y_scal_orig = 0.05, return = FALSE, terms.plot = TRUE, all.terms = TRUE, int.uncertainty = FALSE )fgee.plot( fit, num_row = NULL, xlab = "Functional Domain", title_names = NULL, ylim = NULL, align_x = NULL, x_rescale = 1, y_val_lim = 1.1, y_scal_orig = 0.05, return = FALSE, terms.plot = TRUE, all.terms = TRUE, int.uncertainty = FALSE )
fit |
A fitted object returned by |
num_row |
Number of rows used when arranging plots. |
xlab |
X-axis label. |
title_names |
Optional replacement titles for coefficient plots. |
ylim |
Optional y-axis limits. |
align_x |
Optional value used to re-center the x-axis. |
x_rescale |
Optional x-axis rescaling factor. |
y_val_lim |
Expansion factor for the upper y-axis limit. |
y_scal_orig |
Expansion factor for the lower y-axis limit. |
return |
Logical; if |
terms.plot |
Logical; retained for backwards compatibility. |
all.terms |
Logical; retained for backwards compatibility. |
int.uncertainty |
Logical; retained for backwards compatibility. |
Invisibly returns a list of plotting data frames when
return = TRUE; otherwise draws plots.