Kaushik Bhattacharyya
2002-Aug-30 08:34 UTC
(PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964)
The division part of the following code is not executing - (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS)) Note: Prof Yatracos: Would you please send them one example ? Thanks, Kaushik -----Original Message----- From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk] Sent: Friday, August 30, 2002 4:27 PM To: Kaushik Bhattacharyya Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk Subject: Re: (PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964) Could you us a hint what the problems are? And an example to reproduce them? On Fri, 30 Aug 2002 stakb@nus.edu.sg wrote:> Full_Name: Kaushik Bhattacharyya > Version: 1.5.1 > OS: Solaris > Submission from: (NULL) (137.132.3.10) > > > Main R-function used: > > pp1 > > function(X) > > { > > x_as.matrix(X) > > trial_function(a) > > { > > clusproj(x,a) > > } > > test.nlm_nlm(trial,rep(1,ncol(X))) > > theta_test.nlm$estimate > > theta_theta/sqrt(sum(theta^2)) > > cluster.index_round(1/test.nlm$min,6) > > # print the results > > ############### > > cat(paste("Projection direction = (",paste(round(theta,6), > > collapse=","),")",sep=""),"\n") > > cat("Projection index =",cluster.index,"\n") > > ################## > > w <- clusterproj(x,theta) > > # define first cluster break > > n.break <- seq(w)[round(w,6)>=round(cluster.index,6)] > > n.ord <- order(x%*%theta) > > A.ndx <- n.ord[seq(n.break)] > > B.ndx <- n.ord[seq(n.break+1,dim(x)[1])] > > print(sort(A.ndx)) > > print(sort(B.ndx)) > > } > > > > Functions in the main function: > > > > clusterproj > > function(X,a) { > > a <- a/sqrt(sum(a^2)) > > XS <- sort(X%*%a) > > n <- length(XS) > > w <- > (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS)) > > w > > } > > > > clusproj > > function(X,a) { > > a <- a/sqrt(sum(a^2)) > > XS <- sort(X%*%a) > > n <- length (XS) > > w <- (seq(n > > -1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS)) > > 1/max(w) > > } >-- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
ripley@stats.ox.ac.uk
2002-Aug-30 08:41 UTC
(PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964)
And the error message is? Since you mention this is Solaris, did the the installation pass `make check'? There is a known problem with current gcc compilers on Solaris generating incorrect code. On Fri, 30 Aug 2002, Kaushik Bhattacharyya wrote:> The division part of the following code is not executing - > > (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS))-- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Kaushik Bhattacharyya
2002-Aug-30 09:29 UTC
(PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964)
Yes. It passed the "make check". The problem is coming in Tru64 Unix also. Here is the error message. For example:> clusproj(newiris,rep(1,4))Error in X %*% a : requires numeric matrix/vector arguments Here newiris is the iris dataset. Thanks, Kaushik -----Original Message----- From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk] Sent: Friday, August 30, 2002 4:41 PM To: Kaushik Bhattacharyya Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk; Yannis Yatracos Subject: RE: (PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964) And the error message is? Since you mention this is Solaris, did the the installation pass `make check'? There is a known problem with current gcc compilers on Solaris generating incorrect code. On Fri, 30 Aug 2002, Kaushik Bhattacharyya wrote:> The division part of the following code is not executing - > > (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS))-- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Yannis Yatracos
2002-Aug-30 09:30 UTC
(PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964)
Dear Professor Ripley, thanks much for your prompt action. Best regards, Yannis Yatracos -----Original Message----- From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk] Sent: Friday, August 30, 2002 4:41 PM To: Kaushik Bhattacharyya Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk; Yannis Yatracos Subject: RE: (PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964) And the error message is? Since you mention this is Solaris, did the the installation pass `make check'? There is a known problem with current gcc compilers on Solaris generating incorrect code. On Fri, 30 Aug 2002, Kaushik Bhattacharyya wrote:> The division part of the following code is not executing - > > (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS))-- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Yannis Yatracos
2002-Aug-30 10:21 UTC
(PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964)
Dear Professor Ripley: I hope you can allow me to interfere between you and Kaushik. I think I hav misled him. 1) The function cluproj is used in the function pp1. 2) I called "newiris" just the numerical data from "iris". 3) Writing: clus.proj(as.matrix(newiris),rep(1,4)) gave the following: Error in (seq(n - 1) * mean(XS) - cumsum(XS[seq(n - 1)])) * diff(XS)/((n - : non-conformable arrays 4) A colleague made clusproj work by writing as.vector in front of the numerator and denominator: as.vector((seq(n -1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS))/ as.vector(((n-1)*var(XS))) 5) Here is the result:> clusproj(as.matrix(newiris),rep(1,4))[1] 12.43743 6) Note that the denominator is a scalar. I hope things are more clear now. Best regards, Yannis Yatracos -----Original Message----- From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk] Sent: Friday, August 30, 2002 5:54 PM To: Kaushik Bhattacharyya Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk; Yannis Yatracos Subject: RE: (PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964) 1) That is not where you said the error was. 2) iris is a data frame with five columns, one a factor, and that example should not have worked in 1.3.0 (and I doubt it did). Please do read the section on BUGS in the FAQ. On Fri, 30 Aug 2002, Kaushik Bhattacharyya wrote:> Yes. It passed the "make check". The problem is coming in Tru64 Unix also. > > Here is the error message. > > For example: > > > clusproj(newiris,rep(1,4)) > Error in X %*% a : requires numeric matrix/vector arguments > > Here newiris is the iris dataset. > > Thanks, > > Kaushik > > -----Original Message----- > From: ripley@stats.ox.ac.uk [mailto:ripley@stats.ox.ac.uk] > Sent: Friday, August 30, 2002 4:41 PM > To: Kaushik Bhattacharyya > Cc: r-devel@stat.math.ethz.ch; R-bugs@biostat.ku.dk; Yannis Yatracos > Subject: RE: (PR#1964) The attached function working fine with R 1.3.0 but giving problem with R 1.5.1 (PR#1964) > > > And the error message is? > > Since you mention this is Solaris, did the the installation pass `make check'? There is a known problem with current gcc compilers on Solaris generating incorrect code. > > On Fri, 30 Aug 2002, Kaushik Bhattacharyya wrote: > > > The division part of the following code is not executing - > > > > (seq(n-1)*mean(XS)-cumsum(XS[seq(n-1)]))*diff(XS)/((n-1)*var(XS)) > > > -- > 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 > >-- 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 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-devel-request@stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._