| 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 families, common link functions, and several working correlation structures. Uncertainty quantification is based on sandwich variance estimators and bootstrap procedures that remain valid even when the working correlation is incorrectly specified. The package provides an implementation of the method described in Loewinger et al. (2025) <https://pmc.ncbi.nlm.nih.gov/articles/PMC12306803/>. For irregularly spaced AR(1) precision matrices, the package can optionally use the archived package 'irregulAR1'; if needed, it can be obtained from the CRAN Archive at <https://cran.r-project.org/src/contrib/Archive/irregulAR1/>. |
| Authors: | Gabriel Loewinger [aut, cre] (ORCID: <https://orcid.org/0000-0002-0755-8520>) |
| Maintainer: | Gabriel Loewinger <[email protected]> |
| License: | GPL (>= 3) |
| Version: | 0.1.0 |
| Built: | 2026-05-12 20:04:54 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 functional generalized estimating equations (fGEE) for longitudinal functional outcomes using a one-step estimator, with optional fully iterated final estimation.
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, exact = FALSE, rho.smooth = FALSE, joint.CI = "wild", gee.fit = TRUE, linpred_method = c("accumulate", "matrix"), clip_mu = 0, m.pffr = c(2, 1), check_alignment = TRUE, max.iter = 1, tune.method = c("one-step", "fully-iterated"), boot.samps = 3000, ... )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, exact = FALSE, rho.smooth = FALSE, joint.CI = "wild", gee.fit = TRUE, linpred_method = c("accumulate", "matrix"), clip_mu = 0, m.pffr = c(2, 1), check_alignment = TRUE, max.iter = 1, tune.method = c("one-step", "fully-iterated"), boot.samps = 3000, ... )
formula |
A model formula. The left-hand side should be a functional
response stored as a matrix-like column (typically wrapped in |
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.
One of |
corr_long |
Working correlation in the longitudinal direction.
One of |
time |
Optional name of the longitudinal ordering variable. |
long.dir |
Logical; retained for backwards compatibility. |
var.type |
Variance estimator. One of |
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. |
cv.grid |
Optional grid (or staged grids) of smoothing parameters. |
exact |
Logical; for Gaussian identity-link models, use the exact penalized weighted least-squares update. |
rho.smooth |
Logical; smooth pointwise correlation estimates over the relevant index when applicable. |
joint.CI |
Logical or character controlling joint confidence intervals. |
gee.fit |
Logical; if |
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
|
max.iter |
Maximum number of GEE iterations. |
tune.method |
Smoothing-parameter tuning method. |
boot.samps |
Number of bootstrap replicates used when applicable. |
... |
Additional arguments reserved for future use. |
A "fgee1step" object. pffr_initial.fit contains the initial fit refund::pffr object.
vb contains the variance/covariance matrix for the coefficient estimates (sandwich or bootstrap-based).
qn contains the joint CI quantiles. di and \
wi are lists of length N, with the updated cluster-specific estimating equation and hessian terms (without the penalty).
Gabriel Loewinger [email protected]
Gabriel Loewinger, Alex W. Levis, Erjia Cui, and Francisco Pereira. (2025). Fast Penalized Generalized Estimating Equations for Large Longitudinal Functional Datasets. arXiv:2506.20437.
## Not run: library(fastFGEE) data("data", package = "fastFGEE") fit <- fgee( formula = 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: library(fastFGEE) data("data", package = "fastFGEE") fit <- fgee( formula = 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 and joint confidence intervals when available.
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.