Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface for the cumulative distribution function (CDF) of an Erlang distribution.

Hierarchy

  • CDF

Callable

  • __call(x: number, k: number, lambda: number): number
  • Evaluates the cumulative distribution function (CDF) for an Erlang distribution with shape parameter k and rate parameter lambda at a value x.

    Notes

    • If not provided a nonnegative integer for k, the function returns NaN.
    • If provided a non-positive value for lambda, the function returns NaN.

    Parameters

    • x: number

      input value

    • k: number

      shape parameter

    • lambda: number

      rate parameter

    Returns number

    evaluated CDF

    Example

    var y = cdf( 2.0, 1, 1.0 );
    // returns ~0.865

    Example

    var y = cdf( 2.0, 3, 1.0 );
    // returns ~0.323

    Example

    var y = cdf( 2.0, 2.5, 1.0 );
    // returns NaN

    Example

    var y = cdf( -1.0, 2, 2.0 );
    // returns 0.0

    Example

    var y = cdf( +Infinity, 4, 2.0 );
    // returns 1.0

    Example

    var y = cdf( -Infinity, 4, 2.0 );
    // returns 0.0

    Example

    var y = cdf( NaN, 0, 1.0 );
    // returns NaN

    Example

    var y = cdf( 0.0, NaN, 1.0 );
    // returns NaN

    Example

    var y = cdf( 0.0, 0, NaN );
    // returns NaN

    Example

    var y = cdf( 2.0, -1, 1.0 );
    // returns NaN

    Example

    var y = cdf( 2.0, 1, -1.0 );
    // returns NaN

Index

Methods

Methods

factory

  • factory(k: number, lambda: number): Unary
  • Returns a function for evaluating the cumulative distribution function (CDF) for an Erlang distribution with shape parameter k and rate parameter lambda.

    Parameters

    • k: number

      shape parameter

    • lambda: number

      rate parameter

    Returns Unary

    CDF

    Example

    var mycdf = cdf.factory( 2, 0.1 );
    var y = mycdf( 12.0 );
    // returns ~0.337
    
    y = mycdf( 8.0 );
    // returns ~0.191