[R-SIG-Finance] Quantlib in R (was RE:Financial Basket Options)

Brian G. Peterson brian at braverock.com
Thu Jan 24 14:39:38 CET 2008


Dirk Eddelbuettel wrote:
> Sorry, I meant to chime in earlier on this. Did any of you look at QuantLib?
> AFAICT it has a basketoption class allowing for multiple assets, Monte Carlo
> pricers for american and european exercise as well as Stulz (1992) method.  
> 
> I often look at the available code via what's in the regression tests, so
> here is the header test-suite/basketoption.hpp:
> 
> class BasketOptionTest {
>   public:
>     static void testEuroTwoValues();
>     static void testBarraquandThreeValues();
>     static void testTavellaValues();
>     static void testOneDAmericanValues();
>     static void testOddSamples();
>     static boost::unit_test_framework::test_suite* suite();
> };
> 
> My RQuantLib package currently does not wrap basket options, but has a few
> other exotics one could take as a stanza.  Building the package is possible
> on both Windows and Linux, but somewhat more tedious on the former (as you
> need to build QL and Boost first).  My main contributor Dominick has a
> tarball with that prebuilt if it is of interest.  If there is interest, we
> could add this to RQuantLib.  

Well, I don't really use Windows as an operating system for running R, 
but it seems that adding the required libraries to the Windows version 
of RQuantlib would increase the likelihood of extensions.

On a related note:

I'm really curious whether there's any interest in extending and 
formalizing the SWIG work that was done with Quantlib and R.  It seems 
that the Quantlib team has some interest, as they have added some 
documentation to their site, which is new since the last time I looked:

http://wiki.quantlib.org/twiki/bin/view/Quantlib/RSwigDocumentation

and the SWIG team's "quite incomplete" documentation, which overlaps to 
a degree with the docs on the Quantlib page:

http://www.swig.org/Doc1.3/R.html

Joseph Chen-Yu Wang of the QuantLib team's paper on this may be found here:
http://papers.ssrn.com/sol3/papers.cfm?abstract_id=965317

It seems that it would be good to spend a little time trying to package 
at least some of the SWIG work (possibly into RQuantlib?) so that there 
is a template for adding other functions to R as they are added to Quantlib.

Quantlib is such an extensive and useful collection, it seems that we 
could all benefit from a little more work in that direction.

Regards,

    - Brian



More information about the R-SIG-Finance mailing list