predict.bigKRLS: predict.bigKRLS

Description Usage Arguments Value Examples

Description

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

Usage

1
2
3
## S3 method for class '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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
 
# 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,])

rdrr1990/bigKRLS documentation built on Aug. 2, 2019, 9:13 a.m.