View source: R/relative_entropy.R
relative_entropy | R Documentation |
Computes the relative entropy of two distributions.
relative_entropy(prior, posterior)
prior |
A prior probability distribution. |
posterior |
A posterior probability distribution. |
A double
with the relative entropy.
set.seed(222) prior <- rep(1 / 100, 100) posterior <- runif(100) posterior <- posterior / sum(posterior) relative_entropy(prior, posterior)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.