— views

Nature Loves Entropy. The normal, binomial, Poisson, and other distributions are members of a family, the EXPONENTIAL FAMILY. Nature loves the members of this family. Nature loves them because nature loves entropy, and all of the exponential family distributions are MAXIMUM ENTROPY distributions. -Richard McElreath

A maximum entropy distribution is a probability distribution that satisfies certain constraints while maximizing the entropy. Entropy, in this context, is a measure of the uncertainty of a distribution over outcomes. It therefore also measures surprise.

  1. Uniform distribution: In the absence of any constraints other than the probabilities summing to 1, the maximum entropy distribution is the uniform distribution. In this case, all outcomes have equal probabilities, and the distribution has the maximum possible uncertainty.
n <- 1000  # number of samples
a <- 0     # lower bound
b <- 1     # upper bound

samples_uniform <- runif(n, a, b)
  1. Exponential distribution: When the only constraint is that the expected value (or mean) of the distribution is fixed, the maximum entropy distribution is the exponential distribution. This distribution is commonly used to model waiting times between events in a Poisson process.
n <- 1000
rate <- 1  # inverse of mean

samples_exponential <- rexp(n, rate)
  1. Gaussian (Normal) distribution: When the constraints are the fixed mean and variance, the maximum entropy distribution is the Gaussian distribution. This distribution is widely used in various fields due to the Central Limit Theorem, which states that the sum of many independent, identically distributed random variables approaches a Gaussian distribution.
n <- 1000
mean <- 0
sd <- 1    # standard deviation

samples_gaussian <- rnorm(n, mean, sd)
  1. Boltzmann-Gibbs distribution: In statistical mechanics, the maximum entropy distribution under the constraints of fixed energy and particle number is the Boltzmann-Gibbs distribution. This distribution describes the probability of a system being in a particular energy state and is the foundation of classical statistical mechanics.
n <- 1000
energies <- c(0, 1, 2)  # energy levels
probs <- exp(-energies) # Boltzmann factors
probs <- probs / sum(probs) # normalize probabilities

samples_boltzmann <- sample(energies, n, replace = TRUE, prob = probs)
  1. Laplace distribution: When the constraint is the absolute expected value, the maximum entropy distribution is the Laplace distribution. This distribution has heavier tails than the Gaussian distribution and is often used for modeling phenomena where large deviations from the mean are more likely.
install.packages("extraDistr")
library(extraDistr)

n <- 1000
location <- 0
scale <- 1

samples_laplace <- rlaplace(n, location, scale)
  1. Bernoulli distribution: In the case of binary outcomes (0 or 1), when the constraint is the fixed mean, the maximum entropy distribution is the Bernoulli distribution. This distribution is commonly used to model binary data.
n <- 1000
prob_success <- 0.5

samples_bernoulli <- rbinom(n, 1, prob_success)
  1. Multinomial distribution: In the discrete case with multiple outcomes, when the constraint is the fixed mean, the maximum entropy distribution is the multinomial distribution. This distribution is a generalization of the Bernoulli distribution for more than two outcomes.
n <- 1000
size <- 1
probs <- c(0.3, 0.5, 0.2)

samples_multinomial <- rmultinom(n, size, probs)
  1. Dirichlet distribution: In the continuous case with multiple outcomes, when the constraint is the fixed mean, the maximum entropy distribution is the Dirichlet distribution. This distribution is commonly used as a prior distribution in Bayesian statistics for categorical data.
library(MCMCpack) 

n <- 1000
alpha <- c(2, 3, 4)

samples_dirichlet <- rdirichlet(n, alpha)

Entropy Quotes

Information entropy corresponds to the expected number of yes-or-no questions. If we have to ask a lot of questions, the distribution is uncertain. The Model Thinker by Scott E. Page, Location

The battle to combat entropy by continually having to supply more energy for growth, innovation, maintenance, and repair, which becomes increasingly more challenging as the system ages, underlies any serious discussion of aging, mortality, resilience, and sustainability, whether for organisms, companies, or societies. -Scale by Geoffrey West, Location 397

I found it consoling after all these years to learn that writers are up against nothing less than the fundamental anarchy of the universe; entropy, prince of disorder, is sprinkling noise on everything we write. Ambiguity is noise. Redundancy is noise. Misuse of words is noise. Vagueness is noise. Jargon is noise. Pomposity is noise. Clutter is noise: all those unnecessary adjectives (“ongoing progress”), all those unnecessary adverbs (“successfully avoided”), all those unnecessary prepositions draped onto verbs (“order up”), all those unnecessary phrases (“in a very real sense”).-Writing to Learn by William Zinsser, Location 906