Blog Archives

Sobol Sensitivity Analysis

June 10, 2013
By
Sobol Sensitivity Analysis

Sensitivity analysis is the task of evaluating the sensitivity of a model output Y to input variables (X1,…,Xp). Quite often, it is assumed that this output is related to the input through a known function f :Y= f(X1,…,Xp). Sobol indices are generalizing the coefficient of the coefficient of determination in regression. The ith first order indice is the proportion of...

Read more »

Using RcppProgress to control the long computations in C++

May 16, 2013
By
Using RcppProgress to control the long computations in C++

Usually you write c++ code with R when you want to speedup some calculations. Depending on the parameters, and especially during the development, it is difficult to anticipate the execution time of your computation, so that you do not know if you have to wait for 1 minute or hours. RcppProgress is a tool to help you monitor the...

Read more »

An accept-reject sampler using RcppArmadillo::sample()

May 8, 2013
By
An accept-reject sampler using RcppArmadillo::sample()

The recently added RcppArmadillo::sample() functionality provides the same algorithm used in R’s sample() to Rcpp-level code. Because R’s own sample() is written in C with minimal work done in R, writing a wrapper around RcppArmadillo::sample() to then call in R won’t get you much of a performance boost. However, if you need to repeatedly call sample(), then calling a...

Read more »

An accept-reject sampler using RcppArmadillo::sample()

May 8, 2013
By
An accept-reject sampler using RcppArmadillo::sample()

The recently added RcppArmadillo::sample() functionality provides the same algorithm used in R’s sample() to Rcpp-level code. Because R’s own sample() is written in C with minimal work done in R, writing a wrapper around RcppArmadillo::sample() to then call in R won’t get you much of a performance boost. However, if you need to repeatedly call sample(), then calling a...

Read more »

Using the RcppArmadillo-based Implementation of R’s sample()

April 12, 2013
By
Using the RcppArmadillo-based Implementation of R’s sample()

Overview and Motivation All of R’s (r*, p*, q*, d*) distribution functions are available in C++ via the R API. R is written in C, and the R API has no concept of a vector (at least not in the STL sense). Consequently, R’s sample() function can’t just be exported via the R API, despite its importance and usefulness....

Read more »

Using the RcppArmadillo-based Implementation of R’s sample()

April 12, 2013
By
Using the RcppArmadillo-based Implementation of R’s sample()

Overview and Motivation All of R’s (r*, p*, q*, d*) distribution functions are available in C++ via the R API. R is written in C, and the R API has no concept of a vector (at least not in the STL sense). Consequently, R’s sample() function can’t just be exported via the R API, despite its importance and usefulness....

Read more »

Dynamic Wrapping and Recursion with Rcpp

April 8, 2013
By
Dynamic Wrapping and Recursion with Rcpp

We can leverage small parts of the R’s C API in order to infer the type of objects directly at the run-time of a function call, and use this information to dynamically wrap objects as needed. We’ll also present an example of recursing through a list. To get a basic familiarity with the main functions exported from R API, I...

Read more »

Dynamic Wrapping and Recursion with Rcpp

April 8, 2013
By
Dynamic Wrapping and Recursion with Rcpp

We can leverage small parts of the R’s C API in order to infer the type of objects directly at the run-time of a function call, and use this information to dynamically wrap objects as needed. We’ll also present an example of recursing through a list. To get a basic familiarity with the main functions exported from R API, I...

Read more »

Using bigmemory with Rcpp

March 14, 2013
By
Using bigmemory with Rcpp

The bigmemory package allows users to create matrices that are stored on disk, rather than in RAM. When an element is needed, it is read from the disk and cached in RAM. These objects can be much larger than native R matrices. Objects stored as such larger-than-RAM matrices are defined in the big.matrix class and they are designed...

Read more »

Using bigmemory with Rcpp

March 14, 2013
By
Using bigmemory with Rcpp

The bigmemory package allows users to create matrices that are stored on disk, rather than in RAM. When an element is needed, it is read from the disk and cached in RAM. These objects can be much larger than native R matrices. Objects stored as such larger-than-RAM matrices are defined in the big.matrix class and they are designed...

Read more »