predict.dblm {dbstats} | R Documentation |
Predicted values for a dblm object
Description
predict.dblm
returns the predicted values, obtained by evaluating the
distance regression function in the new data (newdata
).
newdata
can be the values of the explanatory variables of these new
cases, the squared distances between these new individuals
and the originals ones, or rows of new doubly weighted and centered inner
products matrix G.
Usage
## S3 method for class 'dblm'
predict(object,newdata,type.var="Z",...)
Arguments
object |
an object of class |
newdata |
data.frame or matrix which contains the values of Z (if |
type.var |
set de type.var of newdata. Can be |
... |
arguments passed to or from other methods to the low level. |
Value
predict.dblm
produces a vector of predictions for the k new individuals.
Note
Look at which way (or type.var
) was made the dblm
call.
The parameter type.var
must be consistent with the data type that is
introduced to dblm
.
Author(s)
Boj, Eva <evaboj@ub.edu>, Caballe, Adria <adria.caballe@upc.edu>, Delicado, Pedro <pedro.delicado@upc.edu> and Fortiana, Josep <fortiana@ub.edu>
References
Boj E, Delicado P, Fortiana J (2010). Distance-based local linear regression for functional predictors. Computational Statistics and Data Analysis 54, 429-437.
Boj E, Grane A, Fortiana J, Claramunt MM (2007). Selection of predictors in distance-based regression. Communications in Statistics B - Simulation and Computation 36, 87-98.
Cuadras CM, Arenas C, Fortiana J (1996). Some computational aspects of a distance-based model for prediction. Communications in Statistics B - Simulation and Computation 25, 593-609.
Cuadras C, Arenas C (1990). A distance-based regression model for prediction with mixed data. Communications in Statistics A - Theory and Methods 19, 2261-2279.
Cuadras CM (1989). Distance analysis in discrimination and classification using both continuous and categorical variables. In: Y. Dodge (ed.), Statistical Data Analysis and Inference. Amsterdam, The Netherlands: North-Holland Publishing Co., pp. 459-473.
See Also
dblm
for distance-based linear models.
Examples
# prediction of new observations newdata
n <- 100
p <- 3
k <- 5
Z <- matrix(rnorm(n*p),nrow=n)
b <- matrix(runif(p)*k,nrow=p)
s <- 1
e <- rnorm(n)*s
y <- Z%*%b + e
D <- dist(Z)
D2 <- disttoD2(D)
D2_train <- D2[1:90,1:90]
class(D2_train)<-"D2"
dblm1 <- dblm(D2_train,y[1:90])
newdata <- D2[91:100,1:90]
predict(dblm1,newdata,type.var="D2")