| 1 |
|
| 2 |
\begin{tabular}{lcll}\hline |
| 3 |
Variate & $x$ & \ccode{double} & $\mu \leq x < \infty$ \\ |
| 4 |
Location & $\mu$ & \ccode{double} & $-\infty < \mu < \infty$\\ |
| 5 |
Scale & $\lambda$ & \ccode{double} & $\lambda > 0$ \\ |
| 6 |
Shape & $\tau$ & \ccode{double} & $\tau > 0$ \\ \hline |
| 7 |
\end{tabular} |
| 8 |
|
| 9 |
The probability density function (PDF) is: |
| 10 |
|
| 11 |
\begin{equation} |
| 12 |
P(X=x) = \frac{\lambda^{\tau}}{\Gamma(\tau)} (x-\mu)^{\tau-1} e^{-\lambda (x - \mu)} |
| 13 |
\label{eqn:gamma_pdf} |
| 14 |
\end{equation} |
| 15 |
|
| 16 |
The cumulative distribution function (CDF) does not have an analytical |
| 17 |
expression. It is calculated numerically, using the incomplete Gamma |
| 18 |
function (\ccode{esl\_stats\_IncompleteGamma()}). |
| 19 |
|
| 20 |
The ``standard Gamma distribution'' has $\mu = 0$, $\lambda = 1$. |
| 21 |
|
| 22 |
\subsection{Sampling} |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
\subsection{Parameter estimation} |
| 27 |
|
| 28 |
\subsubsection{Complete data; known location} |
| 29 |
|
| 30 |
We usually know the location $\mu$. It is often 0, or in the case of |
| 31 |
fitting a gamma density to a right tail, we know the threshold $\mu$ |
| 32 |
at which we truncated the tail. |
| 33 |
|
| 34 |
Given a complete dataset of $N$ observed samples $x_i$ ($i=1..N$) and |
| 35 |
a \emph{known} location parameter $\mu$, maximum likelihood estimation |
| 36 |
of $\lambda$ and $\tau$ is performed by first solving this rootfinding |
| 37 |
equation for $\hat{\tau}$ by binary search: |
| 38 |
|
| 39 |
\begin{equation} |
| 40 |
\log \hat{\tau} |
| 41 |
- \Psi(\hat{\tau}) |
| 42 |
- \log \left[ \frac{1}{N} \sum_{i=1}^{N} (x_i - \mu) \right] |
| 43 |
+ \frac{1}{N} \sum_{i=1}^N \log (x_i - \mu) |
| 44 |
\label{eqn:gamma_tau_root} |
| 45 |
\end{equation} |
| 46 |
|
| 47 |
then using that to obtain $\hat{\lambda}$: |
| 48 |
|
| 49 |
\begin{equation} |
| 50 |
\hat{\lambda} = \frac{N \hat{\tau}} {\sum_{i=1}^{N} (x_i - \mu)} |
| 51 |
\end{equation} |
| 52 |
|
| 53 |
Equation~\ref{eqn:gamma_tau_root} decreases as $\tau$ increases. |