Serving the Quantitative Finance Community

 
JGJPR
Posts: 12
Joined: September 7th, 2017, 3:33 pm

Re: The "best" method to compute bivariate cumulative normal distribution

September 10th, 2017, 6:47 pm

One requirement is adaptability to other distributions.
This looks to mean that any analytics methods considering 'Gaussianity' does not answer the question, so that a numerical method is welcome.
I don't see any more general methods but copula or monte-carlo.
 
User avatar
Cuchulainn
Topic Author
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: The "best" method to compute bivariate cumulative normal distribution

September 10th, 2017, 8:34 pm

One requirement is adaptability to other distributions.
This looks to mean that any analytics methods considering 'Gaussianity' does not answer the question, so that a numerical method is welcome.
I don't see any more general methods but copula or monte-carlo.
Good question!
The PDE approach I developed all on my very own  can be used with _any_  2d distribution. (and even  3d!). It will be published in my new book.
Quantlib has BVT which I also checked against.

The maths in  Genz 2004 leads to a dead end when you want other kinds of distribution. But not PDE, no Sir.

We notice that the finite difference method give between four and six digits accuracy even when   .NX = NY = 50 (very modest).

 
Typical output is:
 
a, b, rho: 0.88323078,1.0534402, -0.35704502
*Genz West                  : 0.6746688773191766
*Genz QuantLib 1.8          : 0.6746688773191766
 
*Drezner 1978 Quantlib 1.8  : 0.6746688163961295
*FDM approx                 : 0.6752241640580708
FDM approx extrap           : 0.674668544805
 
a, b, rho: -6.3771756,-0.2349262, -0.19490095
*Genz West                  : 5.617457071256493e-12
*Genz QuantLib 1.8          : 5.617457076309991e-12
 
*Drezner 1978 Quantlib 1.8  : 5.451316734811666e-12
*FDM approx                 : 5.588220577826419e-12
FDM approx extrap           : 5.61742692845e-12
 
a, b, rho: -3.6033799,5.1965627, 0.69074304
*Genz West                  : 0.000157052961665832
*Genz QuantLib 1.8          : 0.0001570529616658489
 
*Drezner 1978 Quantlib 1.8  : 0.0001570529616658489
*FDM approx                 : 0.0001563527750848809
FDM approx extrap           : 0.000157052567171
 
a, b, rho: -1.8787828,-5.8789232, 0.3055131
*Genz West                  : 1.003499500688108e-09
*Genz QuantLib 1.8          : 1.003499502515318e-09
 
*Drezner 1978 Quantlib 1.8  : 9.854280102848721e-10
*FDM approx                 : 1.001043599137774e-09
FDM approx extrap           : 1.00349809494e-09
 
a, b, rho: -0.32177054,-2.9262971, -0.46594091
*Genz West                  : 3.560500239620657e-05
*Genz QuantLib 1.8          : 3.560500239620712e-05
 
*Drezner 1978 Quantlib 1.8  : 3.555883404780285e-05
*FDM approx                 : 3.511401126791778e-05
FDM approx extrap           : 3.56043363362e-05
 
a, b, rho: 4.7155323,7.8416032, -0.69093606
*Genz West                  : 0.9999987946014995
*Genz QuantLib 1.8          : 0.9999987946014997
 
*Drezner 1978 Quantlib 1.8  : 0.9999987946014997
*FDM approx                 : 0.9999988671747321
FDM approx extrap           : 0.999998795263
 
a, b, rho: -1.946981,3.1876528, 0.054292586
*Genz West                  : 0.02575683532947779
*Genz QuantLib 1.8          : 0.02575683532947772
 
*Drezner 1978 Quantlib 1.8  : 0.02575684354544463
*FDM approx                 : 0.02568591162309218
FDM approx extrap           : 0.025756830355
 
a, b, rho: -4.7346574,3.0501621, 0.948175
*Genz West                  : 1.097127038323874e-06
*Genz QuantLib 1.8          : 1.097127038329759e-06
 
*Drezner 1978 Quantlib 1.8  : 1.097127038329759e-06
*FDM approx                 : 1.092586880408237e-06
FDM approx extrap           : 1.09712429482e-06
 
a, b, rho: 7.2957037,-7.3891475, -0.80360421
*Genz West                  : 7.245942013444848e-14
*Genz QuantLib 1.8          : 7.245942070366185e-14
 
*Drezner 1978 Quantlib 1.8  : 7.260858581048524e-14
*FDM approx                 : 7.194843962877875e-14
FDM approx extrap           : 7.19003890218e-14
 
a, b, rho: -2.726639,4.9965896, 0.17220467
*Genz West                  : 0.003199150045498287
*Genz QuantLib 1.8          : 0.003199150045498298
 
*Drezner 1978 Quantlib 1.8  : 0.003199150046013107
*FDM approx                 : 0.003186916800067802
FDM approx extrap           : 0.00319914563772
 
Max error West/QL: 1.11022302463e-16
Max error Fdm/West: 0.000555286738894
Max error Fdm Extrap/West: 3.32514473067e-07
 
We notice that the finite difference method give between four and six digits accuracy even when   .
 
 
User avatar
Cuchulainn
Topic Author
Posts: 20252
Joined: July 16th, 2004, 7:38 am
Location: 20, 000

Re: The "best" method to compute bivariate cumulative normal distribution

September 10th, 2017, 8:42 pm

2. Adaptability to 1) other distributions 2) multi-variate versions
Solved.
 
JGJPR
Posts: 12
Joined: September 7th, 2017, 3:33 pm

Re: The "best" method to compute bivariate cumulative normal distribution

September 11th, 2017, 7:22 am

One requirement is adaptability to other distributions.
This looks to mean that any analytics methods considering 'Gaussianity' does not answer the question, so that a numerical method is welcome.
I don't see any more general methods but copula or monte-carlo.
Good question!
The PDE approach I developed all on my very own  can be used with _any_  2d distribution. (and even  3d!). It will be published in my new book.
Quantlib has BVT which I also checked against.

The maths in  Genz 2004 leads to a dead end when you want other kinds of distribution. But not PDE, no Sir.

We notice that the finite difference method give between four and six digits accuracy even when   .NX = NY = 50 (very modest).

 
Typical output is:
 
a, b, rho: 0.88323078,1.0534402, -0.35704502
*Genz West                  : 0.6746688773191766
*Genz QuantLib 1.8          : 0.6746688773191766
 
*Drezner 1978 Quantlib 1.8  : 0.6746688163961295
*FDM approx                 : 0.6752241640580708
FDM approx extrap           : 0.674668544805
 
a, b, rho: -6.3771756,-0.2349262, -0.19490095
*Genz West                  : 5.617457071256493e-12
*Genz QuantLib 1.8          : 5.617457076309991e-12
 
*Drezner 1978 Quantlib 1.8  : 5.451316734811666e-12
*FDM approx                 : 5.588220577826419e-12
FDM approx extrap           : 5.61742692845e-12
 
a, b, rho: -3.6033799,5.1965627, 0.69074304
*Genz West                  : 0.000157052961665832
*Genz QuantLib 1.8          : 0.0001570529616658489
 
*Drezner 1978 Quantlib 1.8  : 0.0001570529616658489
*FDM approx                 : 0.0001563527750848809
FDM approx extrap           : 0.000157052567171
 
a, b, rho: -1.8787828,-5.8789232, 0.3055131
*Genz West                  : 1.003499500688108e-09
*Genz QuantLib 1.8          : 1.003499502515318e-09
 
*Drezner 1978 Quantlib 1.8  : 9.854280102848721e-10
*FDM approx                 : 1.001043599137774e-09
FDM approx extrap           : 1.00349809494e-09
 
a, b, rho: -0.32177054,-2.9262971, -0.46594091
*Genz West                  : 3.560500239620657e-05
*Genz QuantLib 1.8          : 3.560500239620712e-05
 
*Drezner 1978 Quantlib 1.8  : 3.555883404780285e-05
*FDM approx                 : 3.511401126791778e-05
FDM approx extrap           : 3.56043363362e-05
 
a, b, rho: 4.7155323,7.8416032, -0.69093606
*Genz West                  : 0.9999987946014995
*Genz QuantLib 1.8          : 0.9999987946014997
 
*Drezner 1978 Quantlib 1.8  : 0.9999987946014997
*FDM approx                 : 0.9999988671747321
FDM approx extrap           : 0.999998795263
 
a, b, rho: -1.946981,3.1876528, 0.054292586
*Genz West                  : 0.02575683532947779
*Genz QuantLib 1.8          : 0.02575683532947772
 
*Drezner 1978 Quantlib 1.8  : 0.02575684354544463
*FDM approx                 : 0.02568591162309218
FDM approx extrap           : 0.025756830355
 
a, b, rho: -4.7346574,3.0501621, 0.948175
*Genz West                  : 1.097127038323874e-06
*Genz QuantLib 1.8          : 1.097127038329759e-06
 
*Drezner 1978 Quantlib 1.8  : 1.097127038329759e-06
*FDM approx                 : 1.092586880408237e-06
FDM approx extrap           : 1.09712429482e-06
 
a, b, rho: 7.2957037,-7.3891475, -0.80360421
*Genz West                  : 7.245942013444848e-14
*Genz QuantLib 1.8          : 7.245942070366185e-14
 
*Drezner 1978 Quantlib 1.8  : 7.260858581048524e-14
*FDM approx                 : 7.194843962877875e-14
FDM approx extrap           : 7.19003890218e-14
 
a, b, rho: -2.726639,4.9965896, 0.17220467
*Genz West                  : 0.003199150045498287
*Genz QuantLib 1.8          : 0.003199150045498298
 
*Drezner 1978 Quantlib 1.8  : 0.003199150046013107
*FDM approx                 : 0.003186916800067802
FDM approx extrap           : 0.00319914563772
 
Max error West/QL: 1.11022302463e-16
Max error Fdm/West: 0.000555286738894
Max error Fdm Extrap/West: 3.32514473067e-07
 
We notice that the finite difference method give between four and six digits accuracy even when   .
 
Yes, alright, this is indeed another interesting approach!