[R-SIG-Mac]how fast is R on Mac
Jason Liao
jg_liao@yahoo.com
Thu, 26 Jul 2001 12:19:26 -0700 (PDT)
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/