Login  Register

Re: bivariate student cdf?

Posted by Michal Kaut on Apr 16, 2014; 2:09pm
URL: http://quantlib.414.s1.nabble.com/bivariate-student-cdf-tp15157p15164.html

Luigi,

I have a small test case, you can get it from https://db.tt/eYcPFP15 
(too big to send by email).
In addition, I have included a slightly updated version of the
implementation note.

There are four tests in the file:
1. Prints an equivalent of Table 1 from the paper I am using for
formulas (needs manual comparison with the values in the table).

2. Ditto for Table 2.

Both the tables include only tables on the diagonal (y=x), so this is
not a sufficient test.

3. Compare results of cdf with dof = 10000 to normal distribution, for a
range of correlations. This uses the bivariate normal cdf from QuantLib.
The reasoning behind the test is that since normal is the limit case of
student with dof equal to infinity, dof=10000 should be enough for the
two to be virtually equal.

4. Compare results to the values generated by a Matlab file bvtl.m from
http://www.math.wsu.edu/math/faculty/genz/software/software.html.
Note that I have included not only the generated tables, but also bvtl.m
and my script for generating the tables - this is only for you to check
what I did, bvtl.m cannot be distributed with QuantLib as it is under GPL.
The test code expects the comparison tables to reside in folder ./test,
though this is easily changed.

Hope this helps.

Regards,
Michal



On 16/04/14 15:18, Luigi Ballabio wrote:

> Thanks, Michal. Do you have any test cases for the function?
>
> Luigi
>
>
> On Tue, Apr 15, 2014 at 10:06 PM, Michal Kaut <[hidden email]
> <mailto:[hidden email]>> wrote:
>
>     Dear Luigi,
>
>     please find the code attached.
>     (I have only limited experience with GitHub and, moreover, the code
>     needs some QuantLib-ization before it can be added to the library..)
>
>     I have also included a short note with a link to the original paper
>     and explaining some details of the implementation.
>
>     By the way, here is the link with the only other implementation of
>     the bivariate student cdf, which I used for
>     checking:http://www.math.wsu.__edu/math/faculty/genz/__software/software.html
>     <http://www.math.wsu.edu/math/faculty/genz/software/software.html>.
>     (They are based on the same paper, but the codes are GPL.)
>
>     I hope you find the code useful.
>
>     Michal
>
>
>
>     On 15/04/14 21:40, Luigi Ballabio wrote:
>
>         Hello,
>               if you have use for it, then we probably have, too.  :)
>         You can either post the code here, or (if you're familiar with
>         GitHub)
>         send me a pull request.
>
>         Luigi
>
>         On Apr 15, 2014 9:34 PM, "Michal Kaut" <[hidden email]
>         <mailto:[hidden email]>
>         <mailto:[hidden email] <mailto:[hidden email]>>> wrote:
>
>              Hello,
>
>              I am wandering whether you (the QuantLib team) would be
>         interested in a
>              code for bivariate student cdf?
>              I needed it for my code and since I did not find any
>         implementation with
>              a suitable license, I have implemented it myself.
>              I did it in my free time, using formulas from a published
>         paper (from
>              1954), so I have all rights to the code.
>              I checked the code against another library (in Matlab) and
>         it gives the
>              same results.
>
>              At the moment, the code uses standard C/C++ types (double
>         etc), but it
>              should not be a big problem to QuantLib-tify it.
>
>              My question is, do you have use for this (bivariate Student
>         cdf) in
>              QuanLib? And if yes, what is the next step? (I have to
>         admit I have very
>              little experience in contributing code to projects.)
>
>
>              Regards,
>              Michal
>
>
>         ------------------------------__------------------------------__------------------
>              Learn Graph Databases - Download FREE O'Reilly Book
>              "Graph Databases" is the definitive new guide to graph
>         databases and
>              their
>              applications. Written by three acclaimed leaders in the field,
>              this first edition is now available. Download your free
>         book today!
>         http://p.sf.net/sfu/NeoTech
>              _________________________________________________
>              QuantLib-dev mailing list
>         [hidden email]
>         <mailto:[hidden email]>
>              <mailto:[hidden email]
>         <mailto:[hidden email]>>
>         https://lists.sourceforge.net/__lists/listinfo/quantlib-dev
>         <https://lists.sourceforge.net/lists/listinfo/quantlib-dev>
>
>
>
>
> --
> <https://implementingquantlib.blogspot.com>
> <https://twitter.com/lballabio>

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/NeoTech
_______________________________________________
QuantLib-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-dev

attachment0 Download Attachment