Serving the Quantitative Finance Community

 
User avatar
Stefan79
Topic Author
Posts: 0
Joined: October 7th, 2007, 10:01 am

How to invert a Gamma (a, b) CDF?

November 28th, 2007, 3:03 pm

Hi, I need to use an Inverse Gamma CDF to go from default probabilities to firm default barriers. Is there a way to use Quantlib functionality because I have looked and didn't find it so far. I know that one way is to search for the firm default barrier that - when plugged into to the Gamma CDF - yields the desired default probability but I would rather not like to use a search and use the inverse Gamma CDF instead. Is there maybe a function available for C++ because I have not found one outside Quantlib either?Cheers,Stefan
 
User avatar
lognormal
Posts: 0
Joined: November 4th, 2007, 12:46 pm

How to invert a Gamma (a, b) CDF?

November 29th, 2007, 12:32 am

QuoteOriginally posted by: Stefan79Hi, I need to use an Inverse Gamma CDF to go from default probabilities to firm default barriers. Is there a way to use Quantlib functionality because I have looked and didn't find it so far. I know that one way is to search for the firm default barrier that - when plugged into to the Gamma CDF - yields the desired default probability but I would rather not like to use a search and use the inverse Gamma CDF instead. Is there maybe a function available for C++ because I have not found one outside Quantlib either?Cheers,StefanUse a root finding method, bisection if you're not sophisticated or don't care about speed, etc. or you can use a more powerful method, say, Newton's combined with Halley's method for an initial guess. CDFs are non-decreasing so a bracketing method is trivial to apply.
 
User avatar
dobranszky
Posts: 0
Joined: January 8th, 2006, 11:53 am

How to invert a Gamma (a, b) CDF?

December 1st, 2007, 10:56 pm

ALGLIB provides one solution at http://www.alglib.net/specialfunctions/ ... amma.phpIn order to get the inverse of the gamma(a,b) CDF, use invincompletegammac(a, 1. - p) * b
 
User avatar
tbonds
Posts: 0
Joined: July 14th, 2002, 3:00 am

How to invert a Gamma (a, b) CDF?

December 6th, 2007, 9:13 pm

How about Matlab?Statistics Toolbox gaminvInverse of the gamma cumulative distribution function (cdf)Syntax X = gaminv(P,A,B) [X,XLO,XUP] = gamcdf(P,A,B,pcov,alpha)DescriptionX = gaminv(P,A,B) computes the inverse of the gamma cdf with parameters A and B for the corresponding probabilities in P. P, A, and B can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other inputs. The parameters in A and B must all be positive, and the values in P must lie on the interval [0 1].
 
User avatar
ExSan
Posts: 498
Joined: April 12th, 2003, 10:40 am

How to invert a Gamma (a, b) CDF?

December 23rd, 2007, 3:10 pm

Inverse Gamma CDF FORUMS > Numerical Methods Forum > Topic Title: How to invert a Gamma (a, b) CDF? "...I need to use an Inverse Gamma CDF to go from default probabilities to firm default barriers. Is there a way ....Attached program EXSAN.MAIN MENU: 1 ExsanEXSAN MENU: 4 Wilmott Solver WILMOTT MENU: i Inverse Gamma CDF Gamma Distribution G -> (alpha, beta)alpha beta Percentage inv gamma pdf (%) 2.5 --- 2.5 --- 0.5 --- 5.439328 3.2 --- 1.1 --- 0.25 --- 2.074919 3.2 --- 1.1 --- 0.2 --- 1.852616 1.5 --- 2.6 --- 0.65 --- 4.266412 2 --- 1.5 --- 0.97 --- 8.033924 1 --- 1 --- .5 --- 0.6931 1 --- 1 --- .1 --- 0.1053
Attachments
Inverse Gamma CDF _prgrm.zip
(1.29 MiB) Downloaded 106 times
Inverse Gamma CDF _data.zip
(1.98 MiB) Downloaded 89 times