Re: [S] NNET question

Prof Brian Ripley (ripley@stats.ox.ac.uk)
Tue, 13 Oct 1998 16:48:07 +0100 (BST)


I've been away, but not seen a reply to this.

You have forgotten the non-linearities in the hidden units.

> Z(i) = 3.46 - 5.85 * h1 - 8.83 * h2

should be

Z(i) = 3.46 - 5.85 * logistic(h1) - 8.83 * logistic(h2)

I have not checked if this is all that is wrong!

In general such enquiries are best sent to the author of the software, not
S-news (see the introductory document).

> Date: Wed, 7 Oct 1998 12:29:09 -0700 (PDT)
> From: "Thomas J. Downing" <t_downing@yahoo.com>
> Subject: [S] NNET question
> To: s-news@wubios.wustl.edu
>
>
> I am utilizing V & R's nnet library in an attempt to better
> understand neural networks. Although I can make predictions using
> predict.nnet, I do not think I quite understand how predictions are
> derived from the weights given in the output. For example, I have
> fit the following 2-2-1 network :
>
> > z.nnet <- nnet(z ~ x + y,data = ds,size = 2, decay = .007)
> # weights: 9
> initial value 164.278441
> iter 10 value 99.745092
> .
> iter 100 value 97.279519
> final value 97.279519
> stopped after 100 iterations
>
> > summary(z.nnet)
> a 2-2-1 network with 9 weights
> options were - decay=0.007
> b->h1 i1->h1 i2->h1
> 2.16 0.36 3.81
> b->h2 i1->h2 i2->h2
> 5.89 4.91 -2.00
> b->o h1->o h2->o
> 3.46 -5.85 -8.83
>
>
> Given this information, I (naively?) assumed that the forecasting
> equation would be given by:
>
> Z(i) = 3.46 - 5.85 * h1 - 8.83 * h2
>
> where:
> h1 = 2.16 + .36 * x + 3.81 * y
> h2 = 5.89 + 4.91 * x - 2 * y
>
> However, when I use these formulas for prediction, I get very different
> (and obviously very wrong) predictions than those given by
> predict.nnet.
> What am I doing wrong? Thank you in advance for any help with this
> problem!
>
>
>
>
> ==
> -
>
> Thomas J. Downing
> Research Assistant
> Quantitative Research
> Value Line, Inc.
>
> _________________________________________________________
> DO YOU YAHOO!?
> Get your free @yahoo.com address at http://mail.yahoo.com
>
> -----------------------------------------------------------------------
> This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
> send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
> message: unsubscribe s-news

-- 
Brian D. Ripley,                  ripley@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 272860 (secr)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

----------------------------------------------------------------------- This message was distributed by s-news@wubios.wustl.edu. To unsubscribe send e-mail to s-news-request@wubios.wustl.edu with the BODY of the message: unsubscribe s-news