Options
All
  • Public
  • Public/Protected
  • All
Menu

Class KullbackLeibler

Calculate the Kullback–Leibler divergence between 2 distributions with the same variables, D(P||Q).

A value of 0 indicates that the two distributions behave in a very similar or identical way.

Hierarchy

  • KullbackLeibler

Index

Methods

Methods

Static divergence

  • Calculates the Kullback-Leibler divergence D(P||Q). Supports multivariate distributions. Supports discrete or continuous distributions.

    Parameters

    • priorQ: IDistribution

      The distribution Q in D(P||Q), e.g. the Prior.

    • posteriorP: IDistribution

      The distribution P in D(P||Q), e.g. the Posterior.

    • logarithm: LogarithmBase

      The base of the computation.

    Returns number

    The Kullback-Leibler divergence in NATS if the logarithm is natural, BITS if the logarithm is base 2.