pco_predict_preprocess {refund} | R Documentation |
Make predictions using pco basis terms
Description
This function performs the necessary preprocessing for making predictions
with gam
models that include pco
basis
terms. The function pco_predict_preprocess
builds a data.frame
(or augments an existing one) to be used with the usual predict
function.
Usage
pco_predict_preprocess(model, newdata = NULL, dist_list)
Arguments
model |
a fitted |
newdata |
data frame including the new values for any
non- |
dist_list |
a list of |
Details
Models with pco
basis terms are fitted by inputting distances
among the observations and then regressing (with a ridge penalty) on leading
principal coordinates arising from these distances. To perform prediction, we
must input the distances from the new data points to the original points, and
then "insert" the former into the principal coordinate space by the
interpolation method of Gower (1968) (see also Miller, 2012).
An example of how to use this function in practice is shown in
smooth.construct.pco.smooth.spec
.
Value
a data.frame
with the coordinates for the new data
inserted into principal coordinate space, in addition to the supplied
newdata
if this was non-NULL
. This can be used as the
newdata
argument in a call to predict.gam
.
Author(s)
David L Miller
References
Gower, J. C. (1968). Adding a point to vector diagrams in multivariate analysis. Biometrika, 55(3), 582-585.
Miller, D. L. (2012). On smooth models for complex domains and distances. PhD dissertation, Department of Mathematical Sciences, University of Bath.
See Also
smooth.construct.pco.smooth.spec