Estimates prediction error for a function-on-scalar regression model by leave-one-function-out cross-validation (CV), at each of a specified set of points.
pwcv(
fdobj,
Z,
L = NULL,
lambda,
eval.pts = seq(min(fdobj$basis$range), max(fdobj$basis$range), length.out = 201),
scale = FALSE
)A vector of the same length as eval.pts giving the CV
scores.
a functional data object (class fd) giving the
functional responses.
the model matrix, whose columns represent scalar predictors.
a row vector or matrix of linear contrasts of the coefficient functions, to be restricted to equal zero.
smoothing parameter: either a nonnegative scalar or a vector,
of length ncol(Z), of nonnegative values.
argument values at which the CV score is to be evaluated.
logical value or vector determining scaling of the matrix
Z (see scale, to which the value of this argument is
passed).
Philip Reiss phil.reiss@nyumc.org
Integrating the pointwise CV estimate over the function domain yields the
cross-validated integrated squared error, the standard overall model
fit score returned by lofocv.
It may be desirable to derive the value of lambda from an
appropriate call to fosr, as in the example below.
Reiss, P. T., Huang, L., and Mennes, M. (2010). Fast function-on-scalar regression with penalized basis expansions. International Journal of Biostatistics, 6(1), article 28. Available at https://pubmed.ncbi.nlm.nih.gov/21969982/
fosr, lofocv