powered by
Computes the relative entropy of two distributions.
relative_entropy(prior, posterior)
A double with the relative entropy.
double
A prior probability distribution.
A posterior probability distribution.
set.seed(222) prior <- rep(1 / 100, 100) posterior <- runif(100) posterior <- posterior / sum(posterior) relative_entropy(prior, posterior)
Run the code above in your browser using DataLab