Re: Computing Pearson Type V pdf
From: Herman Rubin (hrubin_at_odds.stat.purdue.edu)
Date: 11/25/04
- Next message: George Kahrimanis: "Re: Manipulate Histogram to get specified mean, stddev"
- Previous message: Bruce Weaver: "Re: inaccuracy of SPSS logrank statistics?"
- In reply to: Glen: "Re: Computing Pearson Type V pdf"
- Next in thread: Glen: "Re: Computing Pearson Type V pdf"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Nov 2004 10:27:34 -0500
In article <bd343329.0411241631.4e82c174@posting.google.com>,
Glen <glenbarnett@geocities.com> wrote:
>neilharvey@gmail.com (Neil Harvey) wrote in message news:<2kli4g9dfx9c@legacy>...
>> Hi all,
>> Hoping to find someone out there who's really adept with Gamma
>> functions...
One does not have to be "really adept".
>> I've got an input for a Monte Carlo simulation that's modelled as a
>> Pearson Type V distribution. The probability density function is
>> e^(-b/x) / (b * Gamma(a) * (x/b)^(a+1))
>> Problem is, when the a,b parameters are any size (my input has
>> a=153.3, b=94.7) then Gamma(a) is going to be huge and (x/b)^(a+1) is
>> going to be tiny.
>> Anyone know of any nice identities or expansions that would let me
>> compute this without overflow?
One does not need "nice identities"; just use logarithms.
In this case, the logarithms are going to be easily available,
and some of the additional logarithms are going to be needed
anyhow; doing it with logarithms reduces it to one call to
the exponential function. This is quite common.
>You might (depending on what you need to compute) be able to work
>on the log-scale. There are expansions (and associated algorithms)
>available to compute the log of the Gamma function. Then, for example,
>exp[ -b/x - logGamma(a) + (a+1) log(x/b)]/b would yield the
>desired density. What quantities do you need to compute?
Any good computer package has the logarithm of the Gamma
function as a basic tool, especially for large arguments,
say > 5.
>Of course, with the "a" parameter as large as 150, the distribution
>is going to be extremely close to a normal distribution with the
>same mean and variance; unless you need a great deal of accuracy
>in the extreme upper tail (which would only seem likely to be an issue
>in specialised circumstances), the normal approximation should do very
>well indeed.
A type V random variable is the reciprocal of a Gamma (Type III)
random variable. The density is the Gamma density divided by x^2.
It was not clear what you wanted this for. If you want to
simulate Gamma random variables for large shape parameters,
there are good simple procedures, and all you have to do
to simulate the Type V random variable you want is to take
the standard Gamma random variable for a=153.3 and divide
your value of b (94.7) by the simulated value you get.
It will also be close to normal, but the additional work
needed is not that great. Normal approximations are not
THAT good in general.
-- This address is for information only. I do not claim that these views are those of the Statistics Department or of Purdue University. Herman Rubin, Department of Statistics, Purdue University hrubin@stat.purdue.edu Phone: (765)494-6054 FAX: (765)494-0558
- Next message: George Kahrimanis: "Re: Manipulate Histogram to get specified mean, stddev"
- Previous message: Bruce Weaver: "Re: inaccuracy of SPSS logrank statistics?"
- In reply to: Glen: "Re: Computing Pearson Type V pdf"
- Next in thread: Glen: "Re: Computing Pearson Type V pdf"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|