predict.bigKRLS {bigKRLS} | R Documentation |
Predict function for bigKRLS object. crossvalidate.bigKRLS() provides additional functionality.
## S3 method for class 'bigKRLS' predict(object, newdata, se.pred = FALSE, correct_SE = TRUE, ytest = NULL, ...)
object |
bigKRLS output |
newdata |
New data. Columns in newdata should be ordered identically to columns in X. |
se.pred |
Calculate standard errors on predictions? |
correct_SE |
If se.pred == TRUE, default is to use Neffective (if available) rather than model N in calculating uncertainty of predictions. |
ytest |
Provide testing data to have it returned with the object. Optional. To automatically generate out-of-sample test statistics, use crossvalidate.bigKRLS() instead. |
... |
ignore |
Returns bigKRLS_predicted list object.
# set.seed(123) # y <- as.matrix(ChickWeight$weight) # X <- matrix(cbind(ChickWeight$Time, ChickWeight$Diet == 1), ncol = 2) # N <- length(y) # train <- sample(N, 100, replace = FALSE) # outOfSample <- c(1:N)[-train] # test <- sample(outOfSample, 10, replace = FALSE) # fit <- bigKRLS(y[train], X[train,], instructions = FALSE) # p <- predict(fit, X[test,])