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

lofocv

Leave-one-function-out cross-validation


Description

This internal function, called by fosr() when method="OLS", performs efficient leave-one-function-out cross-validation using Demmler-Reinsch orthogonalization to choose the smoothing parameter.

Usage

lofocv(Y, X, S1, argvals, lamvec = NULL, constr = NULL, maxlam = NULL)

Arguments

Y

matrix of responses, e.g. with columns corresponding to basis function coefficients.

X

model matrix.

S1

penalty matrix.

argvals

values where the functions are evaluated

lamvec

vector of candidate smoothing parameter values. If NULL, smoothing parameter is chosen by optimize.

constr

matrix of linear constraints.

maxlam

maximum smoothing parameter value to consider (when lamvec=NULL).

Value

if lamvec=NULL, a list (returned by optimize) with elements minimum and objective giving, respectively, the chosen smoothing parameter and the associated cross-validation score. Otherwise a 2-column table with the candidate smoothing parameters in the first column and the corresponding cross-validation scores in the second.

Author(s)

Philip Reiss phil.reiss@nyumc.org and Lei Huang

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.