vendredi 24 juin 2016

Accelerate calls to pnorm

Is there a way to optimize a call to pnorm ? I am having some bottleneck in my code and after a lot a optimization and benchmark I realized that it comes from the call to pnorm on relatively big vectors.

With microbenchmarking I got on my machine that if length(u) ~ 1e7 then pnorm(u) takes 1 sec.

Also I noted that using pnorm on one vector on cutting the problem with sapply does not change anything.

Is there a way to use Rcpp here ? or the built-in pnorm is already optimized ?

Any ideas welcome

NOTE I have found these posts on SO: Use pnorm from Rmath.h with Rcpp and How can I use qnorm on Rcpp? but as far as I understood their purpose is to use the R functions into Cpp code




Aucun commentaire:

Enregistrer un commentaire