Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

create.prep.func

Construct a function for preprocessing functional predictors


Description

Prior to using functions X as predictors in a scalar-on-function regression, it is often necessary to presmooth curves to remove measurement error or interpolate to a common grid. This function creates a function to do this preprocessing depending on the method specified.

Usage

create.prep.func(
  X,
  argvals = seq(0, 1, length = ncol(X)),
  method = c("fpca.sc", "fpca.face", "fpca.ssvd", "bspline", "interpolate"),
  options = NULL
)

Arguments

X

an N by J=ncol(argvals) matrix of function evaluations X_i(t_{i1}),., X_i(t_{iJ}); i=1,.,N. For FPCA-based processing methods, these functions are used to define the eigen decomposition used to preprocess current and future data (for example, in predict.pfr)

argvals

matrix (or vector) of indices of evaluations of X_i(t); i.e. a matrix with ith row (t_{i1},.,t_{iJ})

method

character string indicating the preprocessing method. Options are "fpca.sc", "fpca.face", "fpca.ssvd", "bspline", and "interpolate". The first three use the corresponding existing function; "bspline" uses an (unpenalized) cubic bspline smoother with nbasis basis functions; "interpolate" uses linear interpolation.

options

list of options passed to the preprocessing method; as an example, options for fpca.sc include pve, nbasis, and npc.

Value

a function that returns the preprocessed functional predictors, with arguments

newX

The functional predictors to process

argvals.

Indices of evaluation of newX

options.

Any options needed to preprocess the predictor functions

Author(s)

See Also


refund

Regression with Functional Data

v0.1-23
GPL (>= 2)
Authors
Jeff Goldsmith [aut], Fabian Scheipl [aut], Lei Huang [aut], Julia Wrobel [aut, cre], Chongzhi Di [aut], Jonathan Gellar [aut], Jaroslaw Harezlak [aut], Mathew W. McLean [aut], Bruce Swihart [aut], Luo Xiao [aut], Ciprian Crainiceanu [aut], Philip T. Reiss [aut], Yakuan Chen [ctb], Sonja Greven [ctb], Lan Huo [ctb], Madan Gopal Kundu [ctb], So Young Park [ctb], David L. Miller [ctb], Ana-Maria Staicu [ctb]
Initial release
2020-12-03

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.