Returns the natural logarithm of the gamma function.
GAMMALN(x)
returns the natural logarithm of , the gamma function.
x must be greater than 0.
GAMMALN(4)
returns approximately 1.79.
Calculating the Log-Likelihood of a Gamma Distribution
A common application is calculating the log-likelihood of a set of data points assuming they follow a Gamma distribution. The probability density function (PDF) for a Gamma distribution is:
where α is the shape parameter, β is the rate parameter, and (α) is the Gamma function.
The log-likelihood for a single data point xi is ln(f(xi)), which is:
The last term, −ln((α)), is precisely where the GAMMALN function is used to avoid calculating the massive value of (α).
Let's imagine we are a scientist studying the waiting times between major earthquakes in a particular region. Based on historical data, we hypothesize that these waiting times follow a Gamma distribution. We have a set of data points and want to calculate the log-likelihood of these parameters (α=5.5 and β=0.2) to see how well they fit the data.
Here is a table showing the calculation for three historical waiting times, demonstrating the use of the GAMMALN function.
Data and Parameters:
Table of Calculations:
Waiting Time (Years) (xi) | αln(β) | (α−1)ln(xi) | −βxi | -GAMMALN(α) | Log-Likelihood (for one xi) | ||
|---|---|---|---|---|---|---|---|
A | B | C | D | E | F | ||
1 | 15 | -8.8519 | 12.1862 | -3 | -3.9578 | -3.6235 | |
2 | 28 | -8.8519 | 14.9949 | -5.6 | -3.9578 | -3.4148 | |
3 | 35 | -8.8519 | 15.9991 | -7 | -3.9578 | -3.8106 |
Result for GAMMALN(5.5):
Explanation of the Table Columns:
The key takeaway is that the GAMMALN function was a direct and necessary step in this calculation, allowing us to perform a complex statistical analysis without encountering numerical overflow errors.
PRODUCT & FEATURES
RESOURCES
Terms | Privacy | Spam Policy
© 2026 Zapof