Suppose a transportation survey records where people live, their occupations, and how they commute. A causal DAG specifies which variables are parents of others; parameter estimation supplies numerical values for the resulting causal Markov kernels. For categorical variables, those values can be conditional probabilities of each outcome for each combination of parent values. section 3.1.8 section 3.5
Fitting a model means inferring its unknown parameters, such as regression weights or probabilities, from data. A predictive model may aim to represent the observed joint distribution. A causal model instead aims to represent the data-generating process, so fitting numbers does not replace the assumptions encoded in its DAG. section 2.3.4 section 3.5
Several routes produce parameter estimates:
- Maximum likelihood chooses parameters under which the observed data are most likely. Maximizing log-likelihood gives the same optimum; numerical optimization is needed when no mathematical solution is available. section 2.3.4
- Other loss functions change what the fit rewards. Negative log-likelihood is one such loss; L2 regularization adds a penalty that discourages very large parameter values. section 2.3.4
- Bayesian estimation assigns prior distributions to parameters and updates them using data. For categorical probabilities, a Dirichlet prior can smooth estimates based on sparse observations. section 3.1.9
- When data are unavailable, substantive knowledge can supply approximate probabilities. Population and education figures, for example, can inform estimated probabilities of living in a large or small city. section 3.2.3
An extreme probability from sparse data
A frequency-based estimate assigns a probability of 1 to commuting by car for self-employed respondents in small towns: every surveyed person in that group drove. That does not establish that nobody in the wider group cycles or takes a train. A Bayesian fit with Dirichlet pseudo-counts gives car, other, and train probabilities of 0.5, 0.25, and 0.25 for the same parent values. section 3.1.8 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
The pgmpy fit call shows where a Bayesian estimator, Dirichlet prior, and pseudo-counts enter the parameter-learning workflow; get_cpds() retrieves the resulting kernels. section 3.1.9
Parameter estimation is also a step in causal-effect estimation: estimate the model parameters, apply the required model transformation, then run probabilistic inference on the transformed model. Each kernel can have its own parameters, reflecting a distinct modeled mechanism. Whether a causal effect can be identified remains a separate question, particularly when confounders are unobserved. section 11.6.3 section 3.5
