Day 11: Advanced ERGMs and Temporal ERGMs
Specification, network change, and what the model can claim
The Refresher We Need
Olga has already covered:
Why a random-graph baseline matters
The ERGM probability model and change statistics
edges, nodematch, mutual, triangle, and gwesp
MCMC estimation, diagnostics, and goodness of fit
Mesa and rebel-cooperation applications
We will not repeat the full introduction, but we will recover the pieces needed to understand today’s questions.
The course is moving quickly, so I do not want to confuse prior exposure with complete recall. I will briefly recover the question, the comparison, and the estimation logic, then move into what becomes difficult after the introduction.
What Is an ERGM Meant to Answer?
After accounting for the other declared features of the graph, which tie configurations make one possible network more plausible than another?
The model does not stop at:
Are there triangles?
Are there reciprocal ties?
Are similar actors connected?
It asks whether those patterns are more common than the rest of the specification predicts.
The outcome is the whole graph. We usually interpret it through the conditional comparison created by toggling one eligible tie.
I will use one alliance tie as the toggle. The question is not whether alliances form triangles. It is whether the closure toggle receives more probability after density, homophily, activity, and the other included features are represented.
How Is This Different From What We Just Did?
Latent Models
Represent residual dependence through sender, receiver, distance, or multiplicative latent structure.
Useful when the goal is adjustment, representation, or prediction.
ERGM
Represents declared configurations directly in the probability distribution of the graph.
Useful when reciprocity, closure, popularity, or another network feature is itself part of the question.
AME can absorb clustering without naming it. An ERGM can estimate a shared-partner term, but that coefficient still does not prove the behavioral mechanism.
This is a difference in what we choose to parameterize, not a claim that one model is universally better. Day 10 treated latent structure as a way to represent dependence. Today asks when a specific network configuration is the substantive estimand.
How Is an ERGM Estimated?
Start with provisional coefficients.
Simulate whole networks using MCMC tie toggles.
Calculate the statistics in every simulated network.
Compare their averages with the observed graph statistics.
Update the coefficients and repeat.
\[E_{\hat\theta}[g(Y)]\approx g(y_{obs})\]
The fitted model should make the observed sufficient statistics look typical among networks it generates.
I will draw this as a loop and connect it to the code output. The normalizing constant explains why we simulate, but students do not need the full derivation again before they can understand what the algorithm is matching.
What MCMLE Is Maximizing
\[
\ell(\theta;y_{\mathrm{obs}})
=\theta^{\mathsf T}g(y_{\mathrm{obs}})
-\log\kappa(\theta)
\]
The first term rewards parameters that favor the observed statistics. The normalizing term compares that fit with every graph the model permits.
\[
\nabla\ell(\theta)
=g(y_{\mathrm{obs}})-E_{\theta}[g(Y)]
\]
Matching simulated and observed statistics is the maximum-likelihood score condition. MCMC makes that comparison computationally possible.
Why the Extra Machinery Is Worth It
Social relationships can be self-organizing:
Alliances are shaped by existing partners and threats.
Legislative coalitions expand through common collaborators.
Organizations attract ties partly because they are already prominent.
Segregation can emerge from many local relational choices.
Dependence may be part of the process we want to understand, not merely a nuisance in the standard errors.
ERGMs let us put those competing processes into one declared graph model and ask which stories remain compatible with the data.
This is why the extra machinery is worth it. The payoff is a sharper social science comparison. The limit is that a structural coefficient and good fit do not, by themselves, identify a causal actor motivation.
The Models Answer Different Applied Questions
ERGM
Which configurations make this graph more plausible?
Closure is positive conditional on the other represented graph features
Valued ERGM
What explains tie existence and tie magnitude?
Existing ties have greater volume than the reference process predicts
TERGM
How does the preceding network relate to the next one?
Receiving a tie predicts returning it in the next interval
STERGM
Do formation and persistence have different explanations?
Threat predicts alliance formation, while institutions predict survival
Each row needs a different risk set and a different sentence. I want students to hear the social question before the package name and the conditional limit after the result.
Where We Are Going
Decide what process a structural term can actually represent.
Put fitted results into units tied to the observed action.
Separate data, estimation, degeneracy, and fit problems.
Define the outcome and risk set in a network panel.
Distinguish stability, formation, persistence, and sequence.
Decide what a TERGM can claim and where a SAOM asks a different question.
The first half sharpens our use of ERGMs. The second half is the main new model. I will move between these slides and the rendered walkthrough rather than opening a console.
A Triangle Is Not Yet a Mechanism
Triangles in an alliance, cosponsorship, or rebel-cooperation network could reflect:
Partners introducing partners
Shared ideology, geography, or threat
Highly active actors creating triangles mechanically
A genuinely self-reinforcing closure process
Does apparent closure survive after we represent the rival processes our theory says are plausible?
The statistic is exact, but its substantive interpretation is not automatic. A positive closure parameter is evidence about this specification, not a behavioral label attached to every triangle.
Two Nulls Tell Two Different Stories
Density Baseline
What would the network look like if eligible ties occurred at the observed overall rate?
Degree-Constrained Baseline
What would the network look like if actors kept their observed activity and popularity but partners were rearranged?
In the Mesa friendship network, observed transitivity is about 27 times the Erdős-Rényi expectation and about 12 times the degree-preserving expectation. Preserving each student’s number of friends explains part of the clustering, but not all of it.
This is the first place I want students to argue. The null is not a neutral technical choice. It decides which rival process the comparison preserves.
Put Effects on the Friendship Scale
For a proposed tie toggle, move through four steps:
Calculate the change statistics.
Construct the conditional log-odds.
Convert them to a probability.
Average or contrast over configurations that matter for the application.
Fewer than 1 in 100 possible student pairs are friends in Mesa. Same-grade status raises the fitted friendship probability by about 2.8 percentage points, roughly three times the 0.97 percent baseline density.
I will use one actual dyad and show every step. The goal is not to hide the conditional model. It is to connect the model to a sentence someone outside the methods community could evaluate.
Coefficients Can Move When the Scale Moves
Adding a dependence term can change:
The process represented by the model
Every dyad’s conditional predictor
The residual variation left for other terms
The log-odds scale on which coefficients are reported
Do not treat a coefficient difference across nested ERGMs as the amount of omitted-variable bias that was removed.
Compare stated configurations using probabilities, first differences, and simulations.
A coefficient moving is a specification warning, not a clean decomposition. I want to keep that principle in view when we later add memory to the temporal model.
Diagnose Four Different Problems
Data support
Are categories, mixing cells, or transition types empty?
Estimation
Did the MCMC sample mix and reach the target statistics?
Degeneracy
Does the model put mass on nearly empty or complete graphs?
Substantive fit
Do simulated graphs reproduce features the argument needs?
A fix for one row does not repair the other three.
I want students to name the problem before changing control settings or adding terms. More MCMC iterations cannot create ties in an empty mixing cell, and convergence does not imply good fit.
Fixed = TRUE Changes the Model
gwesp(0.25, fixed = TRUE) estimates one coefficient with decay held at 0.25.
gwesp(0.25, fixed = FALSE) treats 0.25 as a starting value and estimates the decay as an additional parameter.
Does the network contain enough information to identify both the strength and shape of shared-partner dependence?
This is a small syntax difference with a large inferential consequence. When decay estimation fails, that is often information about support in this network, not a request to keep increasing iterations.
Simulation Is a Critic, Not a Victory Lap
After fitting, ask simulated networks to reproduce:
Degree and centralization
Reciprocity and mixing
Shared partners and distances
The particular structure needed for the substantive claim
What observed feature would make us withdraw the conclusion if the fitted model consistently missed it?
I want the goodness-of-fit target to come from the argument, not just the package defaults. If the paper is about coalition clustering, reproducing density alone is beside the point.
ERGMs and Latent Models Can Fit the Same Pattern Differently
Latent Factor or AME
Absorbs residual dependence through unobserved actor positions or multiplicative effects.
ERGM
Represents declared network configurations directly in the joint graph distribution.
Similar fit does not imply the same explanation. Neither model identifies closure versus unobserved homophily from one cross-section.
There is no winner slide here. I want to distinguish what each model parameterizes, what it absorbs, and what neither design can identify.
A Cross-Section Cannot Recover Sequence
Suppose an alliance exists in 2010.
The snapshot cannot tell us whether it:
Formed during the preceding interval
Survived from an earlier period
Dissolved and re-formed between observations
Was impossible to observe for part of the interval
Sequence has to be present in the data and represented in the model. It cannot be recovered from a photograph.
This is the transition into the main new material. I will briefly use alliances to clarify formation, survival, and eligibility, then return to the fitted friendship panel.
A TERGM Models Network Transitions
\[\Pr(Y^2,\ldots,Y^T\mid Y^1)=\prod_{t=2}^{T}\Pr(Y^t\mid Y^{t-1})\]
The statistics may reference:
Configurations in the current graph
Dyad states in the preceding graph
Relationships between current and lagged configurations
The coefficient is a conditional association under a transition distribution. It is not automatically a causal effect of an actor’s choice.
The first-order Markov assumption belongs in the substantive discussion. If earlier wars or treaties matter beyond one wave, conditioning on the last network alone may not be enough.
Audit the Temporal Risk Set First
Before writing the formula, verify:
Which actors exist and are eligible in every interval?
Is each dyad an observed zero, missing, or structurally impossible?
Are actor labels and tie direction aligned across waves?
Which version of a time-varying covariate predicts each transition?
Are the observation intervals substantively comparable?
How many transitions do the waves actually provide?
Coding an ineligible state pair as a non-alliance changes the outcome. So does using a covariate measured after the transition. These are estimand decisions, not housekeeping.
Three Terms Ask Three Sequence Questions
Stability
Does the dyad remain in its preceding state?
Delayed reciprocity
Does receiving a tie at \(t-1\) predict returning it at \(t\) ?
Lagged two-path closure
Does a two-path at \(t-1\) predict its closure at \(t\) ?
Current-wave mutual and gwesp describe dependence within \(Y^t\) . They are not substitutes for lagged sequence terms.
For each term, I will draw the configuration before and after. If a claim uses words like return, persist, or close later, the statistic has to encode that ordering.
Stability Favors Keeping the Previous Dyadic State
Compare two otherwise similar student pairs, one previously friends and one previously not.
Previously Friends
If they are friends now, the pair remains in the same state.
Current-friendship contribution: \(+\theta\)
Previously Not Friends
If they are friends now, the pair changes from its previous state.
Current-friendship contribution: \(-\theta\)
\[\text{Difference in current-friendship log-odds}=\theta-(-\theta)=2\theta\]
The corresponding odds ratio is \(\exp(2\theta)\) .
A positive \(\theta\) makes existing friendships more likely to remain and previously absent friendships less likely to form. Stability captures resistance to both kinds of change, not only friendship survival.
The comparison is between two possible student pairs, not between two coefficients. Every other term is held fixed. The stability term contributes positively when the current friendship matches the previous state and negatively when it changes that state. Absolute probabilities still depend on the rest of the model.
The Past Can Change the Structural Story
We fit the same two outcome waves twice:
Current network terms and covariates only
The same specification plus lagged dyad stability
Before either fit, netify validates the three friendship matrices and to_statnet() creates the aligned network list required by btergm.
If reciprocity or closure changes after memory enters, the cross-sectional story was entangled with persistence.
But the coefficient movement is not a clean bias estimate. Compare recognizable configurations on a probability scale and examine simulated transitions.
Both models now explain waves two and three. That makes the comparison cleaner, but the conditional distributions and coefficient scales still differ.
Three Waves Give Us Two Transitions
\[T\text{ waves}=T-1\text{ transitions}\]
The first wave conditions the first transition. It is not another transition outcome.
Can resampling two transitions tell us how a change process varies over time?
This dataset is useful for learning the workflow. It is not a foundation for publication-grade temporal uncertainty.
The network has 50 adolescents and many dyads, but the temporal process is observed only twice. The bootstrap cannot invent missing historical replication.
Estimation Strategy Is Part of the Claim
btergm()
MPLE with bootstrap uncertainty over temporal observations
mtergm()
MCMC maximum likelihood using a constrained block-diagonal representation
Statnet tergm()
Conditional maximum likelihood for a network series
Choose based on the estimand, dependence structure, number of waves, network size, and diagnostics.
We use btergm() for a fast worked example, not because one estimator is universally best.
I want students to be able to explain why they chose the estimator, not just name the package that ran. The small number of transitions matters under every approach.
What btergm() Fits in This Example
\[
\widetilde\ell(\theta)
=\sum_{t=2}^{T}\sum_{i\ne j}
\left[
y_{ijt}\log\widetilde p_{ijt}
+(1-y_{ijt})\log(1-\widetilde p_{ijt})
\right]
\]
The point estimate maximizes a pooled conditional tie pseudolikelihood.
Lagged terms carry information from the preceding network into each transition.
Current-wave dependence terms condition on the other current dyads.
The bootstrap resamples observed transitions and refits the same objective.
This is not the full transition likelihood. With only two transitions, the bootstrap cannot create the missing temporal replication.
Formation and Persistence Need Different Risk Sets
Formation
At risk: dyads without a tie at \(t-1\)
Which eligible pairs form a tie by \(t\) ?
Persistence
At risk: dyads with a tie at \(t-1\)
Which existing ties survive through \(t\) ?
Common threats may help alliances form. Institutions may help established alliances endure. One equation need not describe both processes.
Statnet uses Form() and Persist(). Positive Persist() means less dissolution, while Diss() reverses the statistic and sign interpretation. I will emphasize the risk sets before the syntax because that is where the substantive question lives.
Temporal Fit Must Be Temporal
Simulate one step ahead and check:
Formed, persistent, and dissolved ties
Next-wave degree, reciprocity, mixing, and shared partners
Delayed reciprocity and lagged closure
Calibration of transition probabilities
Held-out later waves when the panel is long enough
In a sparse network, predicting “no tie” everywhere can look accurate. Classification accuracy alone is not a useful validation strategy.
One-step-ahead validation conditions on the observed previous network. Recursive forecasting feeds simulated networks forward and is a harder test. I want those tasks kept separate.
A Temporal Coefficient Is Not Automatically Causal
A lagged term establishes ordering in the model, but causal interpretation still requires:
Defensible timing and measurement
Adequate controls for common causes
A credible risk set
No consequential unobserved change between waves
An identification argument beyond model fit
“Associated with subsequent tie formation” is often accurate. “Causes actors to form ties” usually requires more.
Lagging a variable can clarify temporal order without solving confounding or simultaneity. I want the final sentence to match the design we actually have.
TERGM and SAOM Encode Different Change Stories
TERGM
Specifies the distribution of a network transition, conditional on the preceding network.
SAOM
Represents actors receiving opportunities to make small tie changes between panel waves.
Both use longitudinal networks. They place the process at different levels and rely on different assumptions.
Tomorrow is not a replacement for today. The question is whether the theory is more naturally expressed as a transition distribution or an actor-oriented micro-step process.
After the Model Runs
Name the outcome, transition, and eligible dyads.
Translate terms into before-and-after configurations involving the observed actors and ties.
Report probabilities or first differences for recognizable cases.
Simulate the structures and changes the argument needs.
State what the model does not identify.
“Among these 50 adolescents, pairs that were in the same tie state at the preceding wave receive greater conditional weight to remain in that state at the next wave. The memory estimate is large, but the panel supplies only two transitions, so this is a worked demonstration rather than a stable population estimate.”
This is the paragraph I want after the coefficient table. It names the adolescents, the friendship state, the transition, the fitted pattern, and the limit created by only two transitions.
What to Carry Into Day 12
A structural statistic has an exact mathematical definition but not an automatic substantive mechanism.
Comparisons tied to actors and actions are more useful than an isolated log-odds coefficient.
Data support, estimation, degeneracy, and substantive fit are different problems.
Temporal models require an explicit risk set, lag structure, and transition estimand.
Formation, persistence, and actor-oriented change are related but distinct questions.
The model becomes useful when the substantive story, the risk set, the statistic, and the interpretation all describe the same process.
I will close by asking students to name one sentence they would now rewrite in a network paper. That makes the takeaway about claims, not software.
Why the Extra Machinery Is Worth It
Social relationships can be self-organizing:
Dependence may be part of the process we want to understand, not merely a nuisance in the standard errors.
ERGMs let us put those competing processes into one declared graph model and ask which stories remain compatible with the data.
Read the social science payoff and limit