[Rcpp-commits] r711 - pkg/Rcpp/inst/examples/FastLM

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Wed Feb 17 02:52:44 CET 2010


Author: edd
Date: 2010-02-17 02:52:43 +0100 (Wed, 17 Feb 2010)
New Revision: 711

Modified:
   pkg/Rcpp/inst/examples/FastLM/benchmark.r
Log:
somewhat more dramatic results (given the parameters)

Modified: pkg/Rcpp/inst/examples/FastLM/benchmark.r
===================================================================
--- pkg/Rcpp/inst/examples/FastLM/benchmark.r	2010-02-16 23:13:01 UTC (rev 710)
+++ pkg/Rcpp/inst/examples/FastLM/benchmark.r	2010-02-17 01:52:43 UTC (rev 711)
@@ -26,13 +26,13 @@
 source("lmGSL.R")
 
 set.seed(42)
-n <- 100
-k <- 9
+n <- 25000
+k <- 1
 X <- cbind( rep(1,n), matrix(rnorm(n*k), ncol=k) )
 truecoef <- 1:(k+1)
 y <- as.numeric(X %*% truecoef + rnorm(n))
 
-N <- 500
+N <- 100
 
 lmgsl <- lmGSL()
 lmarma <- lmArmadillo()
@@ -41,4 +41,9 @@
 tlmfit <- mean(replicate(N, system.time(lmfitfit <- lm.fit(X, y))["elapsed"]), trim=0.05)
 tlmgsl <- mean(replicate(N, system.time(lmgsl(y, X))["elapsed"]), trim=0.05)
 tlmarma <- mean(replicate(N, system.time(lmarma(y, X))["elapsed"]), trim=0.05)
-print(c(tlm, tlmfit, tlmgsl, tlmarma))
+
+res <- c(tlm, tlmfit, tlmgsl, tlmarma)
+data <- t(data.frame(results=res, ratios=tlm/res))
+cat("For n=", n, " and k=", k, "\n", sep="")
+print(data)
+



More information about the Rcpp-commits mailing list