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

