UNPKG

@stdlib/stats

Version:

Standard library statistical functions.

36 lines (25 loc) 665 B
{{alias}}( r, p ) Returns the mode of a negative binomial distribution. If provided `NaN` as any argument, the function returns `NaN`. If provided a `r` which is not a positive number, the function returns `NaN`. If provided a success probability `p` outside of `[0,1]`, the function returns `NaN`. Parameters ---------- r: integer Number of failures until experiment is stopped. p: number Success probability. Returns ------- out: number Mode. Examples -------- > var v = {{alias}}( 100, 0.2 ) 396 > v = {{alias}}( 20, 0.5 ) 19 See Also --------