Skip to contents

This is a wrapper for the function mfpca.face from the refund package. EXPAND

Usage

run_mfpca(
  mxFDAobject,
  metric = "uni k",
  r = "r",
  value = "fundiff",
  knots = NULL,
  lightweight = FALSE,
  ...
)

Arguments

mxFDAobject

object of class mxFDA created by make_mxfda() with metrics derived with extract_summary_functions()

metric

name of calculated spatial metric to use

r

Character string, the name of the variable that identifies the function domain (usually a radius for spatial summary functions). Default is "r".

value

Character string, the name of the variable that identifies the spatial summary function values. Default is "fundiff".

knots

Number of knots for defining spline basis.Defaults to the number of measurements per function divided by 2.

lightweight

Default is FALSE. If TRUE, removes Y and Yhat from returned mFPCA object. A good option to select for large datasets.

...

Optional other arguments to be passed to mfpca.face

Value

A mxFDA object with the functional_mpca slot for the respective spatial summary function containing:

mxfundata

The original dataframe of spatial summary functions, with scores from FPCA appended for downstream modeling

fpc_object

A list of class "fpca" with elements described in the documentation for refund::fpca.face

Details

[Stable]

References

Xiao, L., Ruppert, D., Zipunnikov, V., and Crainiceanu, C. (2016). Fast covariance estimation for high-dimensional functional data. Statistics and Computing, 26, 409-421. DOI: 10.1007/s11222-014-9485-x.

Examples

#load data
data(lung_FDA)

#run mixed fpca
lung_FDA = run_mfpca(lung_FDA, metric = 'uni g')
#> 207 sample have >= 4 values for FPCA; removing 0 samples
#> Joining with `by = join_by(patient_id)`