[Rcpp-devel] Recommendations on how to incorporate pmvnorm function
Dirk Eddelbuettel
edd at debian.org
Sun Jan 26 20:15:14 CET 2014
Scott,
On 26 January 2014 at 10:58, Scott Monroe wrote:
| I was hoping for advice on approaches to accomplishing the following goal.
| I'd like to create an R package using Rcpp that calls the pmvnorm (cdf for
| multivariate normal) function from the mvtnorm library. I'd like to avoid
| calling it through R, as I need to do it many times, and I'd like to avoid the
| overhead in going between C++ and R.
|
| The source code, written by Alan Genz, is in Fortran. I've also found on
| GitHub a C++ wrapped version of the Fortran code:
|
| https://github.com/zhanxw/libMvtnorm
|
| The latter includes a Makefile, which I don't know how to handle.
Sorry to break this to you on a Sunday. You will not make very far in
programming if that remains an obstacle for you. You really should buckle
down and read a few tutorial or books on this. It. Is. Not. That. Hard.
Especially with R. And Rcpp. And existing packages -- at current count 164 on
CRAN alone. Look at their sources. Many/most get by without a Makefile
because R knows how to "Do The Right Thing". Including with Fortran.
Now, the proper long-term solution is probably to talk to Torsten to have the
relevant functions exported from his mvtnorm package so that other CRAN
package can re-use the code.
But it's a big world. Maybe someone will write this for you out of the
kindness of their hearts, or maybe you can pay someoone.
Dirk
--
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com
More information about the Rcpp-devel
mailing list