[R] R in Industry

Stefan Grosse singularitaet at gmx.net
Thu Feb 8 18:09:25 CET 2007


I just ran on my Windows PC the benchmark from
http://www.sciviews.org/benchmark/index.html which is pretty old now.
Thats probably the reason for the errors which I did not correct. As
you see R has some advantages but Matlab has also some advantages.
However the differences are not to big. There is only one big
difference which indeed includes loops (Creation of a 220x220 Toeplitz
matrix) where Matlab is much faster. But maybe a simple change in the
programmation can change that...

Has someone in the list an updated script?

Stefan Grosse

The benchmarks:

R 2.4.1
   R Benchmark 2.3
   ===============

   I. Matrix calculation

   ---------------------
Creation, transp., deformation of a 1500x1500 matrix (sec):
0.863333333333335
800x800 normal distributed random matrix ^1000______ (sec):
0.136666666666666
Sorting of 2,000,000 random values__________________ (sec):
0.616666666666665
700x700 cross-product matrix (b = a' * a)___________ (sec):
0.559999999999997
Linear regression over a 600x600 matrix (c = a \ b') (sec):  0 #ERROR


   II. Matrix functions
   --------------------
FFT over 800,000 random values______________________ (sec):
0.559999999999997
Eigenvalues of a 320x320 random matrix______________ (sec):
0.493333333333335
Determinant of a 650x650 random matrix______________ (sec):
0.276666666666666
Cholesky decomposition of a 900x900 matrix__________ (sec):  0 #ERROR
Inverse of a 400x400 random matrix__________________ (sec):  0 #ERROR

   III. Programmation
   ------------------
750,000 Fibonacci numbers calculation (vector calc)_ (sec):
0.466666666666669
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec):
1.01666666666667
Grand common divisors of 70,000 pairs (recursion)___ (sec):
0.396666666666671
Creation of a 220x220 Toeplitz matrix (loops)_______ (sec):
0.553333333333332
Escoufier's method on a 37x37 matrix (mixed)________ (sec):
2.66999999999999

                      --- End of test ---

Matlab 7.0.4

  Matlab Benchmark 2
   ==================
Number of times each test is run__________________________: 3
 
   I. Matrix calculation
   ---------------------
Creation, transp., deformation of a 1500x1500 matrix (sec): 0.29047
800x800 normal distributed random matrix ^1000______ (sec): 0.42967
Sorting of 2,000,000 random values__________________ (sec): 0.71432
700x700 cross-product matrix (b = a' * a)___________ (sec): 0.14748
Linear regression over a 600x600 matrix (c = a \ b') (sec): 0.12831
                  ------------------------------------------------------
                Trimmed geom. mean (2 extremes eliminated): 0.26403
 
   II. Matrix functions
   --------------------
FFT over 800,000 random values______________________ (sec): 0.24591
Eigenvalues of a 320x320 random matrix______________ (sec): 0.38507
Determinant of a 650x650 random matrix______________ (sec): 0.091612
Cholesky decomposition of a 900x900 matrix__________ (sec): 0.11059
Inverse of a 400x400 random matrix__________________ (sec): 0.069414
                  ------------------------------------------------------
                Trimmed geom. mean (2 extremes eliminated): 0.13556
 
   III. Programmation
   ------------------
750,000 Fibonacci numbers calculation (vector calc)_ (sec): 1.2386
Creation of a 2250x2250 Hilbert matrix (matrix calc) (sec): 3.0541
Grand common divisors of 70,000 pairs (recursion)___ (sec): 1.7637
Creation of a 220x220 Toeplitz matrix (loops)_______ (sec): 0.0045972
Escoufier's method on a 37x37 matrix (mixed)________ (sec): 0.50481
                  ------------------------------------------------------
                Trimmed geom. mean (2 extremes eliminated): 1.0331
 
 
Total time for all 15 tests_________________________ (sec): 9.1786
Overall mean (sum of I, II and III trimmed means/3)_ (sec): 0.33316
                      --- End of test ---

-- 
-------------------------------------------
lic. oec. Stefan Grosse

University of Erfurt
Microeconomics
Nordhäuser Str. 63
99089 Erfurt
Germany

phone  +49-361 - 737 45 23
fax    +49-361 - 737 45 29
mobile +49-1609- 760 33 01

web http://www.uni-erfurt.de/mikrooekonomie
mail stefan.grosse at uni-erfurt.de



More information about the R-help mailing list