relative_entropy: Relative Entropy

View source: R/relative_entropy.R

relative_entropyR Documentation

Relative Entropy

Description

Computes the relative entropy of two distributions.

Usage

relative_entropy(prior, posterior)

Arguments

prior

A prior probability distribution.

posterior

A posterior probability distribution.

Value

A double with the relative entropy.

Examples

set.seed(222)

prior <- rep(1 / 100, 100)

posterior <- runif(100)
posterior <- posterior / sum(posterior)

relative_entropy(prior, posterior)

ffp documentation built on Sept. 29, 2022, 5:10 p.m.