Learn R Programming

pnn (version 1.0.1)

smooth: Smooth

Description

Work around the smoothing parameter.

Usage

smooth(nn, sigma, limits = c(0, 10))

Arguments

nn
A trained Probabilist neural network.
limits
Optional. A vector giving the interval (minimum, maximum) in which the function has to search the best value.
sigma
Optional. If the value is already known, it sets directly the parameter and do not search for the best value.

Value

A trained and smoothed Probabilistic neural network.

Details

The function smooth aims to help to set the smoothing parameter for a Probabilist neural network. If you have no idea of which value it can be, you can let the function finds the best value using a genetic algorithm. This can be done providing to the function only the parameter nn. This search takes some time, so if you have already an idea of the value, you can set it if you provide both parameters nn and sigma. If you want to check visually how fit is the sigma value, you can get a plot if you provide nn and set plot to TRUE. It sets the parameters sigma of the neural network.

References

Walter Mebane, Jr. and Jasjeet S. Sekhon. 2011. Genetic Optimization Using Derivatives: The rgenoud package for R. Journal of Statistical Software, 42(11): 1-26.

See Also

pnn-package, learn, perf, guess, norms

Examples

Run this code
library(pnn)
data(norms)

# Search the best value
pnn <- learn(norms)
## Not run: pnn <- smooth(pnn)
## Not run: pnn$sigma

# Or set the value
pnn <- smooth(pnn, sigma=0.8)
pnn$sigma

Run the code above in your browser using DataLab