predict.combitwice: Predict GMDH Twice-Multilayered Combinatorial

Description Usage Arguments Value Examples

View source: R/predict.combitwice.R

Description

Calculates GMDH Twice-Multilayered Combinatorial model predictions for new data.

Usage

1
2
## S3 method for class 'combitwice'
predict(object, newdata, ...)

Arguments

object

an object of class 'combitwice'

newdata

matrix containing dependent variables in the model, wich the predictions are calculated.

...

other undocumented arguments

Value

A matrix with predictions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
set.seed(123)
x <- matrix(data = c(rnorm(1050)), ncol = 3, nrow = 350)
colnames(x) <- c("a", "b", "c")
y <- matrix(data = c(10 + x[, "a"] + x[, "b"]^2 + x[, "c"]^3), ncol = 1)
colnames(y) <- "y"
x.test <- x[1:10, ]
y.test <- y[1:10]
x <- x[-c(1:10), ]
y <- y[-c(1:10)]

mod <- gmdh.combi.twice(X = x, y = y, criteria = "PRESS")
pred <- predict(mod, x.test)
summary(sqrt((pred - y.test)^2))

GMDHreg documentation built on July 5, 2021, 5:09 p.m.