Learn R Programming

BETS (version 0.4.9)

grnn.train: Train a General Regression Neural Network

Description

Creates a set of probabilistic neural networks as proposed by Specht [1991]. The user provides a set of regressors and the function chooses which subset is the best, based on an accuracy measure (by default, the MAPE) between fited and actual values. These networks have only one parameter, the sigma, which is the standard deviation of each activation function (gaussian) of the pattern layer. Sigma can also be automatically chosen. This function builds on grnn-package.

Usage

grnn.train(train.set, sigma, step = 0.1, select = TRUE, names = NA)

Arguments

train.set

A ts list (a list of ts objects). The first element must be the dependent variable. The other elements, the regressors.

sigma

A numeric or a numeric vector. The sigma parameter, that is, the standard deviation of the activation functions (gaussians) of the pattern layer. Can be either a fixed value or a range (a vector containing the minimum and the maximum values).

step

A numeric value. If sigma is a range, the user must provide a step value to vary sigma. The function is going to select the best sigma based on MAPE.

select

A boolean. Must be set to FALSE if the regressors should not be chosen. The default is TRUE.

names

A character vector. Optional. The names of the regressors. If not provided, indexes will be used and reported.

Value

A list of result objects, each representing a network. These objects are ordered by MAPE (the 20 best MAPEs) and its fields are:

  • accuracy: A numeric value. Accuracy measure between the fitted and the actual series values. By default, the MAPE. In future versions, it will be possible to change it.

  • fitted: The fitted values, that is, one step ahead predicitions calculated by the trained net.

  • net: An object returned by the grnn function. Represents a trained net.

  • sigma: A numeric. The sigma that was chosen, either by the user or by the function itself (in case select was set to TRUE)

  • regressors: A character vector. Regressors that were chosen, either by the user or by the fuction itself (in case select was set to TRUE)

  • sigma.accuracy: A data.frame. Sigma versus accuracy value of the corresponding trained network. Those networks were trained using the best set of regressors.

  • residuals: A numeric vector. Fitted values subtracted from the actual values.

grnn.train also returns a diagnostic of training rounds and a sigma versus accuracy plot.