Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Gamma

Represents a random variable with a Gamma distribution with given shape and scale parameters.

The expected (mean) value of a Gamma random variable is equal to the product of its shape and scale parameters.

The Gamma distribution is a generalization of the Erlang distribution where the shape parameter doesn't have to be an integer.

For more information on Gamma distributions see Gamma distribution.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new Gamma(shape: number, scale: number, seed?: number): Gamma
  • Initializes a new instance of the Gamma class.

    Parameters

    • shape: number

      Shape parameter.

    • scale: number

      Scale parameter.

    • Optional seed: number

      Optional value used to initialize the random sequence.

    Returns Gamma

Properties

_scale

_scale: number

_shape

_shape: number

Accessors

scale

  • get scale(): number
  • Gets the value of the scale parameter.

    Returns number

shape

  • get shape(): number
  • Gets the value of the shape parameter.

    Returns number

Methods

sample

  • sample(): number
  • Gets a random value that follows a Gamma distribution with the given shape and scale parameters.

    Returns number

Generated using TypeDoc