dot-fps_fpca: Internal FPCA helper

.fps_fpcaR Documentation

Internal FPCA helper

Description

Performs Functional Principal Component Analysis on a matrix of functional observations using a B-spline basis expansion, then retains enough components to explain at least 'pve' of the total variance. Accepts either an n x T numeric matrix or an fd object from the fda package.

Usage

.fps_fpca(X, pve = 0.95, t_grid = NULL, domain = NULL, nbasis = NULL)

Arguments

X

n x T numeric matrix of observed functional data (rows = subjects), or an fd object.

pve

Proportion of variance explained threshold (default 0.95).

t_grid

Numeric vector of observation time points (length T). Inferred from X when X is an fd object.

domain

Numeric vector c(a, b) giving the domain of the functions. Inferred from X when X is an fd object.

nbasis

Number of B-spline basis functions. If NULL, set automatically.

Value

A named list with components:

scr

n x L matrix of FPC scores.

efn

T x L matrix of eigenfunction values evaluated on t_grid.

mean

Numeric vector of length T: mean function evaluated on t_grid.

eval

Numeric vector of eigenvalues (all, not just L).

varprop

Numeric vector of variance proportions for retained components.

perc

Cumulative variance proportions (all components).

pca_fd

The raw pca.fd object from the fda package.

L

Number of retained components.

t_grid

The t_grid used.

domain

The domain used.


FPScausal documentation built on Aug. 9, 2026, 9:07 a.m.