Login     Register

        Contact Us     Search

XLeratorDB/statistics Documentation

SQL Server TRIGAMMA Function


TRIGAMMA
Updated: 20 January 2017
Use the SQL Server scalar function TRIGAMMA to calculate trigamma(z). Abramowitz and Stegun in Handbook of Mathematical Functions (6.4.1, p.260) defined the polygamma function as:
φ' is known as the trigamma function and is second derivative of the GAMMA function.
Syntax
SELECT [wct].[TRIGAMMA](
   <@X, float,>)
Arguments

Input Name
Definition
@X
The value of interest

Return Type
float
Remarks
·         When @X is a negative integer NULL is returned.
·         When @X = 0 zero is returned
·         Available in XLeratorDB / statistics 2008 only
Examples
Example #1
In the example we evaluate the function at x = 5.
SELECT wct.TRIGAMMA(5) as trigamma
This produces the following result.
Example #2
In this example we use the SeriesFloat function from the XLeratorDB math library to generate a series on numbers from -4 to 4 in steps of .01, calculate the psi value for each number in the series, paste the results to Excel and create a simple graph of the function for the range.
SELECT
   SeriesValue as z
   ,wct.Trigamma(SeriesValue) trigamma
FROM
   wct.SeriesFloat(-4,4,.01,NULL,NULL)
This produces the following result.
See Also
·         FACT - factorial of a number

 



Copyright 2008-2024 Westclintech LLC         Privacy Policy        Terms of Service