diff --git a/articles/dqrng.html b/articles/dqrng.html index 4be1e6f..6dd8d2c 100644 --- a/articles/dqrng.html +++ b/articles/dqrng.html @@ -166,7 +166,7 @@

Usage from Rsystem.time(cat("pi ~= ", piR(N), "\n")) #> pi ~= 3.140899 #> user system elapsed -#> 0.374 0.032 0.405 +#> 0.374 0.024 0.398

Using dqrng is about three times faster:

 library(dqrng)
@@ -174,46 +174,46 @@ 

Usage from Rsystem.time(cat("pi ~= ", piR(N, rng = dqrng::dqrunif), "\n")) #> pi ~= 3.141457 #> user system elapsed -#> 0.222 0.035 0.258

+#> 0.228 0.017 0.245

Since the calculations add a constant off-set, the speed-up for the RNGs alone has to be even greater:

 system.time(stats::runif(N))
 #>    user  system elapsed 
-#>   0.086   0.005   0.091
+#>   0.081   0.004   0.084
 system.time(dqrng::dqrunif(N))
 #>    user  system elapsed 
-#>   0.052   0.004   0.056
+#> 0.045 0.008 0.052

Similar for the exponential distribution:

 system.time(stats::rexp(N))
 #>    user  system elapsed 
-#>   0.338   0.004   0.342
+#>   0.330   0.004   0.333
 system.time(dqrng::dqrexp(N))
 #>    user  system elapsed 
-#>   0.071   0.000   0.071
+#> 0.062 0.004 0.067

And for the normal distribution:

 system.time(stats::rnorm(N))
 #>    user  system elapsed 
-#>   0.367   0.004   0.372
+#>   0.350   0.001   0.350
 system.time(dqrng::dqrnorm(N))
 #>    user  system elapsed 
-#>   0.086   0.008   0.093
+#> 0.088 0.004 0.093

As well as for sampling with and without replacement:

 system.time(for (i in 1:100)   sample.int(N, N/100, replace = TRUE))
 #>    user  system elapsed 
-#>   0.562   0.016   0.578
+#>   0.530   0.012   0.543
 system.time(for (i in 1:100) dqsample.int(N, N/100, replace = TRUE))
 #>    user  system elapsed 
-#>   0.042   0.004   0.046
+#>   0.023   0.020   0.043
 system.time(for (i in 1:100)   sample.int(N, N/100))
 #>    user  system elapsed 
-#>   1.418   0.300   1.718
+#>   1.423   0.244   1.667
 system.time(for (i in 1:100) dqsample.int(N, N/100))
 #>    user  system elapsed 
-#>   0.060   0.008   0.068
+#> 0.058 0.004 0.063

It is also possible to register the supplied generators as user-supplied RNGs. This way set.seed() and dqset.seed() influence both (dq)runif and diff --git a/pkgdown.yml b/pkgdown.yml index a3729b6..a88772e 100644 --- a/pkgdown.yml +++ b/pkgdown.yml @@ -6,5 +6,5 @@ articles: dqrng: dqrng.html parallel: parallel.html sample: sample.html -last_built: 2024-04-07T09:19Z +last_built: 2024-04-07T09:29Z diff --git a/reference/dqrmv-1.png b/reference/dqrmv-1.png index 946423d..bdfab27 100644 Binary files a/reference/dqrmv-1.png and b/reference/dqrmv-1.png differ diff --git a/reference/dqrmv.html b/reference/dqrmv.html index e02181e..3283664 100644 --- a/reference/dqrmv.html +++ b/reference/dqrmv.html @@ -101,11 +101,11 @@

Examples

sigma <- matrix(c(4,2,2,3), ncol=2)
 x <- dqrmvnorm(n=500, mean=c(1,2), sigma=sigma)
 colMeans(x)
-#> [1] 1.097717 2.153056
+#> [1] 0.9886737 2.0223939
 var(x)
 #>          [,1]     [,2]
-#> [1,] 3.947984 1.830991
-#> [2,] 1.830991 3.040779
+#> [1,] 3.962934 2.202450
+#> [2,] 2.202450 3.287562
 plot(x)