liveBook · Manning

Dirichlet distribution

As explained in Causal AI

The Dirichlet distribution is a continuous probability distribution over vectors of nonnegative values that sum to one.

A Dirichlet distribution places a prior over probability vectors: values between zero and one whose entries sum to one, forming a simplex. For categorical outcomes, it is conjugate to the categorical distribution, so observed counts combine with prior parameters to produce another Dirichlet posterior. section 3.1.9

Its practical role in parameter learning is to:

  • Estimate conditional categorical probabilities by combining observed counts with prior parameters. section 3.1.9
  • Smooth extreme maximum-likelihood estimates when sparse data omit plausible outcomes. section 3.1.9
Listing 3.5 Bayesian point estimation with a Dirichlet conjugate prior
from pgmpy.estimators import BayesianEstimator     #1
model.fit(
    data,
    estimator=BayesianEstimator,    #2
    prior_type="dirichlet",
    pseudo_counts=1    #3
) 
causal_markov_kernels = model.get_cpds()      #4
cmk_T = causal_markov_kernels[-1]     #4
print(cmk_T)  #4

A pgmpy fitting call applies a Dirichlet prior with pseudo-counts and retrieves the learned conditional probability distributions. section 3.1.9

Conditional travel probabilities

For travel mode given employment and region, a Dirichlet prior prevents an observed 100% car-use estimate from being treated as certain when the sample contains no cyclists or train users. section 3.1.9

How Causal AI covers it

How deep it goes
Explains simplex support, categorical conjugacy, count updates, and smoothing, but does not derive the distribution mathematically.
Examples
Uses travel-mode probabilities conditioned on employment and region, plus a pgmpy BayesianEstimator listing.
What it assumes
Assumes categorical probability parameters and Bayesian estimation while defining the simplex constraint and conjugate update role.
What you can do after
Apply it via pgmpy to estimate smoothed categorical conditional probabilities from data.
How it connects
Connects Bayesian estimation, conjugate priors, categorical distributions, maximum likelihood estimation, and smoothing.

Also explained in

Compare how 2 books explain Dirichlet distribution →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal AI. The section links point to the parts of the book it draws on.