smooth
objects produced by smooth.construct
methods and obtains the matrix mapping
the parameters associated with such a smooth to the predicted values of the smooth at a set of new covariate values.In practice this method is often called via the wrapper function PredictMat
.
Predict.matrix(object,data)
smooth.construct
method function. The object
contains all the information required to specify the basis for a term of its class, and this information is
used by the appropriate Predict.matrix
funobject
. If the smooth class
is one which generates offsets the corresponding offset is returned as
attribute "offset"
of the matrix.xx.smooth.spec
during processing of the formula. Each of these objects is
converted to a smooth object using an appropriate smooth.construct
function. The Predict.matrix
functions are used to obtain the matrix that will map the parameters associated with a smooth term to
the predicted values for the term at new covariate values.Note that new smooth classes can be added by writing a new smooth.construct
method function and a
corresponding Predict.matrix
method function: see the example code provided for
smooth.construct
for details.
gam
,gamm
,
smooth.construct
, PredictMat
# See smooth.construct examples
Run the code above in your browser using DataLab