matician - v2.0.0
    Preparing search index...

    Class Bernoulli

    Class representing the Bernoulli distribution.

    Index

    Constructors

    Accessors

    p q

    Methods

    Constructors

    Accessors

    Methods

    • Returns the cumulative distribution function value at x.

      Parameters

      • x: number

        Outcome value.

      Returns number

      Cumulative probability up to x.

    • Returns the probability mass function value at x.

      Parameters

      • x: number

        Outcome (0 or 1).

      Returns number

      Probability of observing x.

    • Generates a random sample (0 or 1) from the distribution.

      Returns number

      A sampled value from the distribution.