[Rcpp-devel] Recommendations on how to incorporate pmvnorm function

Dirk Eddelbuettel edd at debian.org
Thu Jan 30 17:56:56 CET 2014


Hi Dale,

Most excellent follow-up -- thanks for that.

On 30 January 2014 at 16:40, Smith, Dale (Norcross) wrote:
| QuantLib has a modification due to Graeme West of Allen Genz's algorithm from pmvnorm. You may be able to call that code in your project by linking with it. Genz also has Fortran code on his web site. Perhaps that would be useful as well.

Hah. Which subdirectory?  

I could just call accees that via RQuantLib and we'd have it.
 
| I think it's easy enough to read the 2004 paper and write up your own. Follow Genz's suggestions for the numerical integration part.
| 
| There are other algorithms floating around since 2004. However, I would be skeptical of these unless I could get access to extensive tests, comparing to known verified implementations. Having done work on this topic myself, I would say that the West modification of the Genz algorithm is the fastest and most accurate, especially for the trivariate case. I've not seen any specific algorithms for the quadvariate case, although the quadvariate normal probability integral does show up in quant finance.
| 
| http://www.wilmott.com/pdfs/090721_west.pdf
| 
| Google my presentation "Bank Capital Models and Bivariate Normal Probability Calculations" for some references.

I think you just volunteered to (co-)authored to short Rcpp Gallery (or maybe
even R Journal / JSS Code Snippet) piece.  If you let me be your co-author I
think I'd be happy to help. 

I did look at Torsten's package innards but not for very long...

Dirk

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rcpp-devel mailing list