Skip to contents

Converts retained FDA intervals into ordinary subject-level predictors for downstream modeling.

Usage

extract_fda_features(
  analysis,
  alpha = NULL,
  value_cols = NULL,
  prefix = "fda",
  statistics = "mean",
  time_grid = NULL,
  max_allowed_missing_pct = NULL
)

Arguments

analysis

A windcut_fda_analysis object returned by run_fda_analysis().

alpha

Significance level used to select retained intervals. If NULL, the first alpha value stored in analysis is used.

value_cols

Optional subset of weather variables to extract.

prefix

Prefix used in feature names.

statistics

Interval statistics to compute. Use function names such as "mean", "sd", and "IQR", a named list of custom functions, or a named list by variable. When using a variable-level list, .default can supply statistics for variables not named explicitly.

time_grid

Expected numeric measurement times on the original scale. If NULL, uses the union of observed times across subjects. Supply the expected grid to count times missing for every subject. Use measurement times, rather than the denser grid used to plot smoothed curves.

max_allowed_missing_pct

Maximum missing percentage (0 to 100). Drop a predictor if any subject exceeds this limit. NULL keeps all predictors. The coverage table keeps the diagnostics for dropped predictors.

Value

A list with features and coverage data frames, each with one row per subject. The subject identifier appears in both tables.

Details

Feature names encode the interval endpoints using the same offset codes as make_windows(): m for negative, z00 for zero, and p for positive offsets. FDA summaries include observations at both endpoints. Subject-time pairs must be unique and infinite measurements are rejected.