rStats.js v1.3.0
    Preparing search index...

    Function psigamma

    • Polygamma function, the derivative of order deriv of digamma. Equivalent to R's psigamma(). Takes a single number.

      psigamma(-Infinity, deriv) is Infinity for odd deriv as in R, which treats it like the poles (NaN with rCompatible: false). Unlike R, which returns NaN for x < 0 with deriv >= 6 and where the result overflows, the value is computed there.

      Parameters

      • x: number

        Argument.

      • deriv: number = 0

        Order of the derivative, an integer from 0 to 100 (rounded half to even; default 0, digamma).

      • Optionaloptions: RCompatibleOptions

        rCompatible (default true).

      Returns number

      psi^(deriv)(x). At zero and the negative integers, Infinity for odd deriv and NaN for even. NaN if deriv is outside 0 to 100.

      psigamma(2, 2);  // -0.40411380631918853 (-2 (zeta(3) - 1))