predict.gia {GMDHreg} | R Documentation |
Predict GMDH GIA object
Description
Calculates GMDH GIA Twice model predictions for new data.
Usage
## S3 method for class 'gia'
predict(object, newdata, ...)
Arguments
object |
an object of class 'giatwice' |
newdata |
matrix containing dependent variables in the model, wich the predictions are calculated. |
... |
other undocumented arguments |
Value
A matrix with predictions.
Examples
set.seed(123)
x <- matrix(data = c(rnorm(500)), ncol = 4, nrow = 125)
colnames(x) <- c("a", "b", "c", "d")
y <- matrix(data = c(10 + x[, "a"] + x[, "d"]^2), ncol = 1)
colnames(y) <- "y"
x.test <- x[1:5, ]
y.test <- y[1:5]
x <- x[-c(1:5), ]
y <- y[-c(1:5)]
mod <- gmdh.gia(X = x, y = y, criteria = "PRESS")
pred <- predict(mod, x.test)
summary(sqrt((pred - y.test)^2))
[Package GMDHreg version 0.2.3 Index]