GMDHreg: an R Package for GMDH Regression

Introduction.

GMDH (Group Method of Data Handling) was originated in 1968 by Prof. Alexey G. Ivakhnenko in the Institute of Cybernetics in Kiev.

GMDHreg has been designed for regression analysis. For this porpouse, it includes the next algorithms: Combinatorial, MIA (Multilayered Iterative Algorithm), Combinatorial with Active Neurons, and GIA (Generalized Iterative Algorithm).

Following a heuristic and Perceptron type approach, Ivakhnenko attempted to resemble the Kolmogorov-Gabor polynomial by using low order polynomials. GMDH performs sorting-out of gradually complicated polynomial models and selecting the best solution using so called external criteria. So that, GMDH algorithms give us the possibility to find automatically interrelations in data, to select an optimal structure of model or network, by means of this external criteria.

To estimate the polynomials coefficients, it is used the least squares method. In this aspect, GMDHreg employs Singular Value Decomposition (SVD) to avoid singularities.

External Criteria.

It is one of the key features of GMDH, describing some requirements to the model, like the optimal structure. It is always calculated with a separate part of data that have not been used for estimation of polynomial coefficients. GMDHreg give us three possibilities:

  • PRESS: Predicted Residual Error Sum of Squares. It take into account all information in data sample and it is computed without recalculating of system for each test point.
  • test: It is the classical aproach, dividing initial data in training and testing subsamples. The training subsample is used to derive estimates for the coefficients of the polynomials, and the test subsample is used to choose the structure of the optimal model.
  • ICOMP: Index of Informational Complexity. Like PRESS, it is computed without recalculating of system.

GMDH Combinatorial (GMDH-COMBI).

This is the basic GMDH algorithm. It uses an input data sample containing N rows of observations and M predictor variables.

This algorithm generates models of all possible input variable combinations and selects a final best model from the generated set of models according to a chosen selection criterion. The coefficients βi of these models are determined by linear regression and are unique for each neuron.

Be careful with this. At GMDHreg, if you select original Ivakhnenko quadratic polynomial (G = 2) and M > 4, the computational time could be very expensive, even the algorithm could never be calculated. For M input variables, GMDH Combinatorial generate 2(M′ − 1) models (e.g. M = 5 =  > M′ = 20 then you have 219 models to estimate).

Suposse you have two variables x1 x2 and a response y. The models to estimate are 25:

y = β0 + β1x1

y = β0 + β1x2

...

y = β0 + β1x1 + β2x2 + β3x12 + β4x22 + β5x1x2

Once all these models are estimated, the one with the best external criteria is selected.

data(airquality)

# Remove NAs
BD <- airquality[complete.cases(airquality), ]

y <- matrix(data = BD[, "Ozone"], ncol = 1)
x <- as.matrix(BD[, c("Solar.R", "Wind", "Temp")])

# Select the training and testing set
set.seed(123)
sel <- sample(1:nrow(x), size = 100)

x.train <- x[sel, ]
y.train <- y[sel, ]
x.val <- x[-sel, ]
y.val <- y[-sel, ]

# Fitting a simple linear regression for benchmark proposes
mod.lm <- lm(y.train ~., data = as.data.frame(x.train))
fit.lm <- predict(mod.lm, as.data.frame(x.val))
error.lm <- summary(abs(fit.lm - y.val) / y.val)

mod.combi <- gmdh.combi(X = x.train, y = y.train, criteria = "PRESS", G = 2)
fit.combi <- predict(mod.combi, x.val)
error.combi <- summary(abs(fit.combi - y.val) / y.val)

GMDH Combinatorial with Active Neurons. GMDH Twice-Multilayered Combinatorial (GMDH-TMC).

It is an extension of Combinatorial algorithm. It constructs the first layer of neurons in the network like GMDH-COMBI. Then, the algorithm determines how accurate the predictions will be for all neurons.

At a second stage, with M2 best neurons as regressors, GMDH-TMC repeats the proces for a second, a third,… {i} layer, as long as this decreases external criteria value.

At GMDHreg, Mi = M, and it does not implement the orginal idea of Ivakhnenko who introduces a feed-forward system. Note that this is computationally very expensive, especially if G = 2.

mod.combi.twice <- gmdh.combi.twice(X = x.train, y = y.train, criteria = "PRESS", G = 2)
fit.combi.twice <- predict(mod.combi.twice, x.val)
error.combi.twice <- summary(abs(fit.combi.twice - y.val) / y.val)

GMDH Multilayered Iterative Algorithm (GMDH-MIA).

The basis of GMDH-MIA is that each neuron in the network receives input from exactly two other neurons, except neurons at input layer. The two inputs are then combined to produce a partial descriptor based on the simple quadratic transfer function (a quadratic polynomial):

yi = β0 + β1x1, i + β2x2, i + β3x1, i2 + β4x2, i2 + β5x1, ix2, i

where coefficients βi are determined by linear regression and are unique for each neuron.

The network of polynomials is constructed one layer at a time. The first network layer consists of the functions of each possible pair of n input variables resulting in n(n − 1)/2 neurons. The second layer is created using inputs from the first layer and so on.

Due to the exponential neurons growth, after finishing the layer, a limited number of best neurons is selected and the other neurons are removed from the network. GMDH-MIA repeat the proces for third, fourth,… layer, as long as decreases external criterion value.

mod.mia <- gmdh.mia(X = x.train, y = y.train, prune = 150, criteria = "PRESS")
fit.mia <- predict(mod.mia, x.val)
error.mia <- summary(abs(fit.mia - y.val) / y.val)

GMDH Generalized Iterative Algorithm (GMDH-GIA).

This algorithm is similar to GMDH-MIA, but (1) each neuron is an active unit, its output is automatically selected thanks to GMDH-COMBI and, (2) GMDH-GIA works with a feed-forward system, where initial regressors are used at all layers to avoid information lose.

mod.gia <- gmdh.gia(X = x.train, y = y.train, prune = 10, criteria = "PRESS")
fit.gia <- predict(mod.gia, x.val)
error.gia <- summary(abs(fit.gia - y.val) / y.val)