bigKRLS (version 3.0.5.1)

predict.bigKRLS: predict.bigKRLS

Description

Predict function for bigKRLS object. crossvalidate.bigKRLS() provides additional functionality.

Usage

# S3 method for bigKRLS
predict(object, newdata, se.pred = FALSE,
  correct_SE = TRUE, ytest = NULL, ...)

Arguments

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

Value

Returns bigKRLS_predicted list object.

Examples

Run this code
# NOT RUN {
 
# 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,])
# }

Run the code above in your browser using DataLab