This set of functions revolve around the polygamma functions, i.e. the derivatives of the gamma function.
Arguments
- x, y
numeric. The points to evaluate the function.
- ...
extra arguments passed to
optim().- p
integer. The p-variate Gamma function.
- log
logical. Should the logarithm of the result be returned?
Details
These functions are needed for the beta and gamma distribution families (and their multivariate analogs, e.g. the Dirichlet). They appear in the estimation and the asymptotic variance-covariance matrix of the MLE and the SAME.
The idigamma() function implements the inverse of the digamma function
\(\psi\). It is a numerical approximation based on the L-BFGS-U
quasi-Newton algorithm. Specifically, idigamma() makes a call to optim()
in order to to solve the equation \(\psi(x) = y\); more accurately, to find
the minimum of \(f(x) = \log\Gamma(x) - xy\), whose derivative is
\(f'(x) = \psi(x) - y\). The optimization is restricted within the tight
bounds derived by Batir (2017). The function is vectorized.
Functions
idigamma(): inverse digamma function.Ddigamma(): digamma difference function.Dtrigamma(): trigamma difference function.gammap(): p-variate gamma function