Page 1 of 1

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

Posted: November 28th, 2007, 3:03 pm
by Stefan79
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

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

Posted: November 29th, 2007, 12:32 am
by lognormal
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.

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

Posted: December 1st, 2007, 10:56 pm
by dobranszky
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

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

Posted: December 6th, 2007, 9:13 pm
by tbonds
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].

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

Posted: December 23rd, 2007, 3:10 pm
by ExSan
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