The value includes the weight decay term: it is a penalized fit. See the documentation pages 245 and 247. (nnet is support software for a book, so the book is the primary documentation.)

On Fri, 29 May 2009, Andrea Weidacher wrote:


Hi there,

I?ve a question concerning the nnet package in the area of survival analysis: 
what is the final value, which is computed to fit the model with the following 
nnet-c
all:

net <- nnet(cat~x,
       data=d,
       size=2,
       decay=0.1,
       censored=TRUE,
       maxit=20,
       Wts=rep(0,22),
       Hess=TRUE)

where cat is a matrix with a row for each record and one column for each 
possible time-value and x another explanatory variable.
Something like that:

0 6 17 20 28 37
[1,] 0 0  0  0  0  1
[2,] 1 0  0  0  0  0
[3,] 0 0  1  1  1  1
[4,] 0 1  0  0  0  0
...

where 0,6,17,... are the time values and record 1 has an event in time period 
37 and record 3 is censored in time period 20.


I tried to reproduce the final value with this term:

tmp <- rowSums(cat*summary(net)$fitted.values)
repFinalValue <- sum(-log(tmp))

but got the value 21.65438 instead of 21.71108. Is this only a rounding error or what?s wrong with my formula?

My whole test example is printed below.

[...]

--
Brian D. Ripley,                  rip...@stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to