50% off | Unlimited Data & AI Learning
Get 50% off unlimited learning

kldest (version 1.0.0)

kld_uniform: Analytical KL divergence for two uniform distributions

Description

This function computes DKL(p||q), where pU(a1,b1) and qU(a2,b2), with a2<a1<b1<b2.

Usage

kld_uniform(a1, b1, a2, b2)

Value

A scalar (the Kullback-Leibler divergence)

Arguments

a1, b1

Range of true uniform distribution

a2, b2

Range of approximate uniform distribution

Examples

Run this code
kld_uniform(a1 = 0, b1 = 1, a2 = 0, b2 = 2)

Run the code above in your browser using DataLab