[S] Splus inconsistences in nnet V&R2 example

Matthew R. Nelson (mrn@superh.hg.med.umich.edu)
Tue, 3 Mar 1998 11:28:12 -0500 (EST)


S-users,

A collegue of mine is attempting to apply neural networks in S-PLUS to a
problem analogous to the example given in V&R2, pp 340-341. He installed
the latest MASS library, but was unable to reproduce the example results
when testing the library. Has anyone had similar problems?

Included below is his statement of the problem and the S-session.

-----------------------------------------------------------------------------
PROBLEM:
Failed to reproduce results of neural network analysis in section 11.4 of
Ripley's, Statistics and Computing, Modern Applied Statistics with S-PLUS
SECOND EDITION

HISTORY:
1) loaded libraries into Splus 3.3 for AIX and into Splus 4.0 for Win95
2) both yielded the same results, however they were both different from
the book
3) My results of neural network section (11.4)
> library(MASS,first=T)
> library(nnet)
> attach(rock)
> area1 <- area/10000; peri1 <- peri/10000
> rock.x <- cbind(area1,peri1,shape)
> set.seed(5555)
> rock.nn <-
nnet(rock.x,log(perm),size=3,decay=1e-3,linout=T,skip=T,maxit=1000)
# weights: 19
initial value 1820.342503
.....
final value 14.553864
converged
> summary(rock.nn)
a 3-3-1 network with 19 weights
options were - skip-layer connections linear output units decay=0.001
b->h1 i1->h1 i2->h1 i3->h1
-0.61 -9.21 14.41 3.41
b->h2 i1->h2 i2->h2 i3->h2
0.42 -1.01 -0.29 -0.78
b->h3 i1->h3 i2->h3 i3->h3
3.25 -13.61 -4.60 -0.69
b->o h1->o h2->o h3->o i1->o i2->o i3->o
8.14 -15.35 0.66 5.81 -1.93 -4.26 3.09
> sum((log(perm) - predict(rock.nn,rock.x))^2)
[1] 13.66272
> eigen(nnet.Hess(rock.nn,rock.x,log(perm)),T)$values
[1] 496.103041499 65.119461887 25.929061430 2.790166927
1.601920251
[6] 0.789552910 0.278820911 0.185972207 0.158672571
0.035966827
[11] 0.017537664 0.010825091 0.007761906 0.006875149
0.002571314
[16] 0.002287781 0.001930422 -0.003297977 -0.004959100

______________________________________________________________________
Paul Matthew Kopec University of Michigan Medical School
Senior Systems Analyst Department of Human Genetics
Email: pkopec@umich.edu Phone: (734)-763-5411
______________________________________________________________________

Matt Nelson

-----------------------------------------------------------------------
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