Dear list,

 

I have been trying to reproduce the scripts of the MASS library and I have
found a problem when trying to reproduce the code in 12.4, with the use of
neural networks and the function b1:

 

b1 <- function(Z, ...)

{

   zp <- Z[,3] - pmax(Z[,2], Z[,1])

   contour(xp/log(10), yp/log(10), matrix(zp, np),

      add=T, levels=0, labex=0, ...)

   zp <- Z[,1] - pmax(Z[,3], Z[,2])

   contour(xp/log(10), yp/log(10), matrix(zp, np),

      add=T, levels=0, labex=0, ...)

}

 

Using this function, the contours appear in a much reduced zone of the
chart. Instead, if I use

 

b1 <- function(Z, ...)

{

   zp <- Z[,3] - pmax(Z[,2], Z[,1])

   contour(exp(xp), exp(yp), matrix(zp, np),

      add=T, levels=0, labex=0, ...)

   zp <- Z[,1] - pmax(Z[,3], Z[,2])

   contour(exp(xp), exp(yp), matrix(zp, np),

      add=T, levels=0, labex=0, ...)

}

 

I get similar panels to the ones in the book. Also, this choice would be
consistent with the functions predplot and cushplot.

 

Am I doing something wrong? 

 

Regards

 

Jordi

 


        [[alternative HTML version deleted]]

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to