repl.txt (1458B)
1 2 {{alias}}( x, k ) 3 Evaluates the natural logarithm of the probability density function (PDF) 4 for a chi-squared distribution with degrees of freedom `k` at a value `x`. 5 6 If provided `NaN` as any argument, the function returns `NaN`. 7 8 If provided `k < 0`, the function returns `NaN`. 9 10 Parameters 11 ---------- 12 x: number 13 Input value. 14 15 k: number 16 Degrees of freedom. 17 18 Returns 19 ------- 20 out: number 21 Evaluated logPDF. 22 23 Examples 24 -------- 25 > var y = {{alias}}( 0.3, 4.0 ) 26 ~-2.74 27 > y = {{alias}}( 0.7, 0.7 ) 28 ~-1.295 29 > y = {{alias}}( -1.0, 0.5 ) 30 -Infinity 31 > y = {{alias}}( 0.0, NaN ) 32 NaN 33 > y = {{alias}}( NaN, 2.0 ) 34 NaN 35 36 // Negative degrees of freedom: 37 > y = {{alias}}( 2.0, -1.0 ) 38 NaN 39 40 // Degenerate distribution when `k = 0`: 41 > y = {{alias}}( 2.0, 0.0, 2.0 ) 42 -Infinity 43 > y = {{alias}}( 0.0, 0.0, 2.0 ) 44 Infinity 45 46 47 {{alias}}.factory( k ) 48 Returns a function for evaluating the natural logarithm of the probability 49 density function (PDF) of a chi-squared distribution with degrees of freedom 50 `k`. 51 52 Parameters 53 ---------- 54 k: number 55 Degrees of freedom. 56 57 Returns 58 ------- 59 logpdf: Function 60 Logarithm of probability density function (PDF). 61 62 Examples 63 -------- 64 > var myLogPDF = {{alias}}.factory( 6.0 ); 65 > var y = myLogPDF( 3.0 ) 66 ~-2.075 67 68 See Also 69 -------- 70