R: A interface function to use nnet() function within GAMLSS
nn
R Documentation
A interface function to use nnet() function within GAMLSS
Description
The nn() function is a additive function to be used for GAMLSS models.
It is an interface for the nnet() function of package
nnet of Brian Ripley. The function nn() allows the user to use neural networks
within gamlss. The great advantage of course comes from the fact GAMLSS models provide a variety of distributions and diagnostics.
A formula containing the expolanatory variables i.e. ~x1+x2+x3.
control
control to pass the arguments for the nnet() function
...
for extra arguments
size
number of units in the hidden layer. Can be zero if there are skip-layer units
linout
switch for linear output units. Default is TRUE, identily link
entropy
switch for entropy (= maximum conditional likelihood) fitting. Default by least-squares.
softmax
switch for softmax (log-linear model) and maximum conditional likelihood fitting. linout, entropy, softmax and censored are mutually exclusive.
censored
A variant on softmax, in which non-zero targets mean possible classes. Thus for softmax a row of (0, 1, 1) means one example each of classes 2 and 3, but for censored it means one example whose class is only known to be 2 or 3.
skip
switch to add skip-layer connections from input to output
rang
Initial random weights on [-rang, rang]. Value about 0.5 unless the inputs are large, in which case it should be chosen so that rang * max(|x|) is about 1
decay
parameter for weight decay. Default 0.
maxit
parameter for weight decay. Default 0.
Hess
If true, the Hessian of the measure of fit at the best set of weights found is returned as component Hessian.
trace
switch for tracing optimization. Default FALSE
MaxNWts
The maximum allowable number of weights. There is no intrinsic limit in the code, but increasing MaxNWts will probably allow fits that are very slow and time-consuming.
abstol
Stop if the fit criterion falls below abstol, indicating an essentially perfect fit.
reltol
Stop if the optimizer is unable to reduce the fit criterion by a factor of at least 1 - reltol.
Details
Note that, neural networks are over parameterized models and therefor notorious for multiple maximum.
There is no guarantee that two identical fits will produce identical results.
Value
Note that nn itself does no smoothing; it simply sets things up for the function gamlss() which in turn uses the function
additive.fit() for backfitting which in turn uses gamlss.nn()
Warning
You may have to fit the model several time to unsure that you obtain a reasonable minimum
Rigby, R. A. and Stasinopoulos D. M. (2005). Generalized additive models for location, scale and shape,(with discussion),
Appl. Statist., 54, part 3, pp 507-554.
Ripley, B. D. (1996) Pattern Recognition and Neural Networks. Cambridge.
Stasinopoulos D. M., Rigby R.A. and Akantziliotou C. (2006) Instructions on how to use the GAMLSS package in R.
Accompanying documentation in the current GAMLSS help files, (see also http://www.gamlss.org/).
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R.
Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007, http://www.jstatsoft.org/v23/i07.
Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S. Fourth edition. Springer.