Search Ctrl K
Home / Tools
THE FEUTEX TOOLKIT

Gaussian KL Divergence

Quantify directed divergence between two univariate normal distributions.

Statistics workspace● Runs in your browser
01 Your input
02 Your result
View or copy raw result data
FormulaKl P To Q = log(s2/s1)+(s1**2+(m1-m2)**2)/(2*s2**2)-0.5; Kl Q To P = log(s1/s2)+(s2**2+(m1-m2)**2)/(2*s1**2)-0.5
Sources and model references

Made for real tasks

  • Quantify directed divergence between two univariate normal distributions.
Explore step-by-step workflows →

Worked example

Inputs

First mean
0 number
First standard deviation
1 number
Second mean
1 number
Second standard deviation
2 number

Expected results

Kl P To Q
0.4431471806 nats
Kl Q To P
1.306852819 nats

Load the example in the workspace to reproduce these results. Display rounding does not change the underlying calculation.

How to use this tool

  1. Enter first mean, first standard deviation, second mean, second standard deviation.
  2. Use the displayed units and confirm the model assumptions.
  3. Calculate and compare the outputs against your input scenario.

Try this example

{
  "m1": 0,
  "s1": 1,
  "m2": 1,
  "s2": 2
}

Accuracy and scope

KL is directed and not a distance metric; both models must be normal with positive variance.

Is my data uploaded?

This tool runs locally in your browser. Input and output are not sent to a processing server. Copy or download your result before leaving the page.