Description Usage Arguments Details Value Author(s) References See Also
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.
1 | pco_predict_preprocess(model, newdata = NULL, dist_list)
|
model |
a fitted |
newdata |
data frame including the new values for any non- |
dist_list |
a list of |
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
.
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
.
David L Miller
Gower, J. C. (1968). Adding a point to vector diagrams in multivariate analysis. Biometrika, 55(3), 582-585. http://doi.org/10.2307/2334268
Miller, D. L. (2012). On smooth models for complex domains and distances. PhD dissertation, Department of Mathematical Sciences, University of Bath. Available at http://opus.bath.ac.uk/31800/
smooth.construct.pco.smooth.spec
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.