Chalkboard - v3.0.4
    Preparing search index...

    Function Bayes

    • Calculates the posterior probability using Bayes' theorem.

      Parameters

      • pA: number

        The prior probability of A (i.e. P(A))

      • pGivenA: number

        The probability of B given A (i.e. P(B|A))

      • pGivenNotA: number

        The probability of B given not A (i.e. P(B|!A))

      Returns number

      const result = Chalkboard.stat.Bayes(0.01, 0.99, 0.05); // Returns the posterior probability