## S3 method for class 'lazy':
predict(object, newdata=NULL,
t.out=FALSE, k.out=FALSE,
S.out=FALSE, T.out=FALSE, I.out=FALSE, \dots)lazy.i of all the samples (X[i,],Y[i]) used to
perform each estimation.q elements, where q is the number of
rows in newdata, i.e. the number of query points. The element
in position i is the estimate of the value of the unknown function
in the query point newdata[i,]. The component h is
always returned.z*q elements, where z=z2 i.e., number of
parameters of a quadratic model if at least one model of degree 2
was identified (see quaIdPar in lazy.control),
otherwise z=z1 i.e.,
number of parameters of a linear model if at least one model of
degree 1 was identified (see linIdPar in
lazy.control), or z=1 if only
models of degree 0 where considered. In the general case,
the elements of the vector t[,j]=c(a0, a1,..., an, a11,
a12,..., a22, a23,..., a33, a34,..., ann) are
the parameters of the local model used for estimating
the function in the jth query point: the cross-terms terms
a11,a12,...,ann wil be missing if no quadratic model is
identified and the terms a1,...,an, will be missing if
no linear model is identified. If, according to cmbPar (see
lazy.control), estimations are to be performed by a
combination of models, the elements of t[,j] are a weighted
average of the parameters
of the selected models where the weight of each model is the
inverse of the a leave-one-out estimate of the variances of the
model itself. REMARK: a translation of the axes is considered
which centers all the local models in the respective query point.q elements. Selected number of neighbors
for each query point. If, according to cmbPar (see
lazy.control), a local
combination of models is considered, k[j] is the largest
value among the number of neighbors used by the selected models
for estimating the value in the jth query point.S is returned only if S.out=TRUE in
the function call.T is returned only if
T.out=TRUE in the function call.idM*q elements, where idM is the
largest of idM0, idM1, and idM2. Contains the
index of the neighbors of each query point in newdata.
In particular, I[i,j] is the ith nearest neighbor of
the qth query point.lazy, lazy.controldata(cars)
cars.lazy <- lazy(dist ~ speed, cars)
predict(cars.lazy, data.frame(speed = seq(5, 30, 1)))Run the code above in your browser using DataLab