rgamma-distributiongamma-function

Is there a function calculating derivative of digamma function?


I want to calculate the derivative of digamma function in R.

R has an existing function called digamma, but I cannot find a function for the derivative of digamma function. Is it possible to write code for differentiated digamma function in R?

Thanks.


Solution

  • Sure, it is called trigamma

    q <- trigamma(3)
    

    There is also psigamma: psigamma(x, deriv) (deriv >= 0) computes the deriv-th derivative of ψ(x).