Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

logmdigamma

Log Minus Digamma Function


Description

The difference between the log and digamma functions.

Usage

logmdigamma(x)

Arguments

x

numeric vector or array of positive values. Negative or zero values will return NA.

Details

digamma(x) is asymptotically equivalent to log(x). logmdigamma(x) computes log(x) - digamma(x) without subtractive cancellation for large x.

Author(s)

Gordon Smyth

References

Abramowitz, M., and Stegun, I. A. (1970). Handbook of mathematical functions. Dover, New York.

See Also

Examples

log(10^15) - digamma(10^15) # returns 0
logmdigamma(10^15) # returns value correct to 15 figures

statmod

Statistical Modeling

v1.4.36
GPL-2 | GPL-3
Authors
Gordon Smyth [cre, aut], Yifang Hu [ctb], Peter Dunn [ctb], Belinda Phipson [ctb], Yunshun Chen [ctb]
Initial release
2021-05-10

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.