Suppose femur length helps determine height, but femur length alone cannot account for every difference in height. A structural causal model (SCM) represents those unmodeled causes with an exogenous variable. The variables modeled explicitly are endogenous; their values are set by assignment functions that take their causal parents, including exogenous parents, as inputs. section 6.1.3 section 6.1.2
In one formulation, each endogenous variable receives a latent exogenous parent. Exogenous variables have no parents and are independent of one another before observations are made. Their distributions supply the model's randomness: once the exogenous values and other causal parents are fixed, each assignment function sets its endogenous value deterministically. This is a modeling assumption about how causes produce outcomes, not a claim that the unmodeled causes have been individually identified. section 6.1.3 section 6.1.7
Move variation into exogenous inputs
A simple SCM samples n_x ~ Normal(0, 2.3) and n_y ~ Normal(0, 3.3), then assigns x := 47 + n_x and y := 25 + 3x + n_y. Here n_y represents variation in height not accounted for by femur length. Sampling the inputs still produces a distribution of heights, although height is fixed for any given x and n_y. section 6.1.2 section 6.1.7
Listing 6.2 CGM rewritten as an SCM
from pyro.distributions import Normal
from pyro import sample
def scm_model():
n_x = sample("n_x", Normal(0., 2.3)) #1
n_y = sample("n_y", Normal(0., 3.3)) #1
x = 47. + n_x #2
y = 25. + 3.*x + n_y #2
return x, y #3
The Pyro listing makes the boundary visible: sample the exogenous variables, then calculate the endogenous variables with ordinary assignments. section 6.1.2
To build or fit an SCM, choose both an assignment-function class and an exogenous distribution. An additive model, for example, assigns y := f(x) + n_y; a linear Gaussian version uses a linear function and normally distributed noise. Distribution choices can be compared against data, but fit alone does not establish the correct causal mechanism. Different assignments or reparameterizations can preserve the same observed distribution while implying different causal inferences. section 6.4.2 section 6.2.1 section 6.4.3
Exogenous variables also connect an observed case to a counterfactual. First infer their values or posterior distribution from observed endogenous outcomes (abduction). Then retain that information while applying a hypothetical intervention and propagating values through the assignment functions. Independent exogenous priors need not remain independent after conditioning on observations; an inference procedure that ignores the resulting dependencies can introduce bias. section 9.1.1 section 9.1.3 section 9.3.3

