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.
library(pnn)
data(norms)
# Search the best valuepnn <- learn(norms)
## Not run: pnn <- smooth(pnn)## Not run: pnn$sigma# Or set the valuepnn <- smooth(pnn, sigma=0.8)
pnn$sigma