[R-SIG-Mac]how fast is R on Mac
Don MacQueen
macq@llnl.gov
Thu, 26 Jul 2001 13:45:15 -0700
About 34 seconds on a 400 MHz G3, R 1.2.2, OS 9.1
(not OS X, I can probably test that later today or tomorrow with R 1.2.3)
-Don
> print(date());
[1] "Thu Jul 26 13:37:06 2001"
> sum <- 0;
> for(i in 1:100000)
+ {
+ odds.ratio <- exp(runif(1));
+ sum <- sum + hyper(50, 50, 50, odds.ratio);
+ }
> print(date());
[1] "Thu Jul 26 13:37:40 2001"
> print(date());
[1] "Thu Jul 26 13:37:40 2001"
>
At 12:19 PM -0700 7/26/01, Jason Liao wrote:
>I am interested in knowing the speed of R on Mac OS X. Can anyone run
>the following code? It runs on a Pentium III 600 MH with 57 seconds.
>Please indicate the hardware configration. Thanks in advance.
>
>Jason Liao
>
> hyper <- function(n1,n2,m1,psi)
> {
> mode.compute <- function()
> {
> a <- psi - 1;
> b <- (m1+n1+2)*psi + n2-m1 ;
> b <- -b;
> c <- psi*(n1+1)*(m1+1);
> q <- b + sign(b)*sqrt(b*b-4*a*c);
> q <- -q/2;
>
> return(c/q);
> }
>
> N <- n1+n2;
> l <- max(0, m1-n2);
> u <- min(n1, m1);
>
> mode <- mode.compute()
>
> return(mode);
> }
>
> print(date());
> sum <- 0;
> for(i in 1:100000)
> {
> odds.ratio <- exp(runif(1));
> sum <- sum + hyper(50, 50, 50, odds.ratio);
> }
> print(date());
> print(date());
>
>
>
>=====
>Jason G. Liao
>Department of Biometry and Epidemiology
>Medical University of South Carolina
>135 Rutledge Ave., STE 1148, Charleston, SC 29425
>phone (843) 876-1114, fax (843) 876-1126
>
>http://www.geocities.com/jg_liao/index.html
>
>__________________________________________________
>Do You Yahoo!?
>Make international calls for as low as $.04/minute with Yahoo! Messenger
>http://phonecard.yahoo.com/
>_______________________________________________
>R-SIG-Mac mailing list
>R-SIG-Mac@stat.math.ethz.ch
>http://www.stat.math.ethz.ch/mailman/listinfo/r-sig-mac
--
--------------------------------------
Don MacQueen
Environmental Protection Department
Lawrence Livermore National Laboratory
Livermore, CA, USA
--------------------------------------