---
title: "Day 14: Which Model, When?"
engine: knitr
editor: source
subtitle: "From one comparison to a full toolkit"
author: "Shahryar Minhas"
format:
  revealjs:
    theme: _deck_theme.scss
    slide-number: c/t
    transition: fade
    controls: true
    progress: true
    hash: true
    center: false
    width: 1600
    height: 900
    margin: 0.055
    embed-resources: true
    html-math-method: mathml
---

## The Question That Outlasts the Course {#route}

::: {.room-prompt}
What is the substantive quantity you want, where does the important dependence live, and which assumptions are you willing to defend?
:::

::: {.bottom-line}
Choose a model from the question and data structure. Do not choose a question because a familiar model is available.
:::

::: {.slide-link}
[Open the Day 14 path](day14_capstone.html#sec-question){.walkthrough-link target="_blank"}
:::

::: {.notes}
Opening point: this is not a recap of package syntax. One rebel-cooperation network anchors the fitted model comparison so differences in estimand and interpretation stay visible, then the final sections open a separate tour of methods beyond the course.
:::

## Days 8 Through 10 Built the Relational Toolkit {#course-rundown-1}

<style>
#course-rundown-1 .bottom-line { font-size: 0.82em; padding: 0.35em 0.55em; margin-top: 0.35em; }
</style>

| Day | Main question | Tools you now have |
|---|---|---|
| 8: Network foundations | What exactly are the actors, ties, eligible pairs, and patterns in this network? | `netify` for building, checking, reshaping, and describing network data |
| 9: SRM and blockmodels | Are broad actor differences or recurring relational roles organizing the ties? | `lame` and `blockmodels` for additive effects and cross-sectional roles; NetMix for actor-year role mixtures without a fitted transition model |
| 10: Latent distance, latent factors, and AME | Which pairs remain unusually compatible after measured covariates and broad actor differences? | `latentnet` for latent distance and `lame` for signed relational surfaces, covariate adjustment, uncertainty, and goodness-of-fit |

::: {.bottom-line}
The sequence moved from defining ties, to finding broad actor structure, to modeling pair-specific structure that the measured variables missed.
:::

::: {.slide-link}
[Review the first half of the course map](day14_capstone.html#sec-course-rundown){.walkthrough-link target="_blank"}
:::

::: {.notes}
Start with Day 8 because every later model inherits its actor set, tie definition, eligibility rule, missing-data decisions, and time scale. Day 9 separated two kinds of simplification: SRM gives each actor an overall relational tendency, while blockmodels ask whether a small number of recurring roles summarize partner patterns. Day 10 compared proximity in a latent-distance space with a signed low-rank factor surface for pair-specific compatibility, then combined the factor surface with additive effects and measured predictors in AME. Name the software only after naming the question each tool answers.
:::

## Days 11 Through 13 Added Structure, Change, and Design {#course-rundown-2}

| Day | Main question | Tools you now have |
|---|---|---|
| 11: ERGM and TERGM | Do named configurations such as reciprocity or closure help describe one network or a panel of networks? | `ergm` and `btergm`, change statistics, simulation-based interpretation, and goodness-of-fit |
| 12: SAOM | What actor-oriented sequence of small tie and behavior changes could connect the observed waves? | `RSiena` with `netify`, method-of-moments estimation, micro-step interpretation, and simulation checks |
| 13: Network causal inference | What comparison would identify the effect, and how can interference break an ordinary design? | Exposure mappings, Horvitz-Thompson estimates, negative controls, and careful limits on causal claims |

::: {.bottom-line}
These tools do not form a ladder from simple to advanced. They answer different questions about configurations, change between waves, and causal comparisons.
:::

::: {.slide-link}
[Review the second half of the course map](day14_capstone.html#sec-course-rundown){.walkthrough-link target="_blank"}
:::

::: {.notes}
Day 11 made network configurations explicit and used simulated networks to ask whether the fitted model reproduces the features that matter. Day 12 changed the temporal story: actors receive opportunities for small changes between observed waves, and estimation matches simulated statistics to observed statistics. Day 13 focused on causal identification under interference and hidden selection. The point of this recap is to give students a usable map, not a list of package names.
:::

## Start by Naming the Target {#target}

Possible targets include:

- An observed covariate association with uncertainty that allows shared actors
- Actor sending and receiving propensities
- Discrete relational types
- A latent relational surface
- An explicit graph configuration such as closure
- Influence among actors

::: {.big-question}
Is dependence something to account for, a process you want to describe, or the main thing you want to measure?
:::

::: {.notes}
First question: name one target and one nuisance feature. That keeps the payoff table from becoming a contest over which model looks most sophisticated.
:::

## Every Lens Must Earn Its Place {#model-compass}

For each model, finish four sentences:

1. **The substantive question is...**
2. **This model helps because...**
3. **It is distinct from the previous lens because...**
4. **After fitting it, I can say...**

::: {.say-it}
If the fourth sentence still sounds like package documentation, the model has not yet produced an applied result.
:::

::: {.slide-link}
[Read the model-by-model substantive interpretations](day14_capstone.html#sec-model-compass){.walkthrough-link target="_blank"}
:::

::: {.notes}
The walkthrough completes these sentences for the models students have already learned. I will use the same four prompts as we move through the fitted lenses.
:::

## The Same Network Becomes Different Evidence {#estimation}

| Lens | Pattern the model tries to explain |
|---|---|
| GLM | Measured dyadic associations |
| SRM | Persistent differences in actors' overall activity |
| Blockmodel | A small set of recurring partner-list types |
| AME | Continuous pair-specific compatibility |
| ERGM | Named graph configurations such as shared partners |
| TERGM | Tie transitions across observed network waves |
| SAOM | Actor-oriented micro-changes between observed waves |

::: {.bottom-line}
TERGM and SAOM require repeated network observations, so they belong in the course map but cannot be fitted to today's single snapshot.
:::

::: {.slide-link}
[Compare the estimation strategies](day14_capstone.html#sec-estimation-roadmap){.walkthrough-link target="_blank"}
:::

::: {.notes}
Estimation table before the model sequence. The same data supply different evidence because each lens conditions on a different dependence representation.
:::

## What Each Procedure Actually Fits {#estimation-targets .smaller}

| Lens | Statistical target |
|---|---|
| GLM | Maximize dyad-level Bernoulli log-likelihood |
| Capstone SRM and AME | Sample a joint posterior distribution |
| Blockmodel | Maximize a variational likelihood lower bound |
| ERGM | Maximize a graph likelihood using simulated network statistics |
| TERGM with `btergm` | Fit a conditional tie-transition model by MPLE; use a temporal bootstrap for uncertainty |
| SAOM | Use simulated method of moments to match observed network and behavior change statistics |

::: {.say-it}
These are the model-fitting procedures covered in the course. DCR appears after the GLM because it recalculates uncertainty rather than fitting a new network process.

The fast longitudinal `lame` examples used ALS point estimation instead of posterior sampling.
:::

::: {.slide-link}
[Connect Every Algorithm to Its Target](day14_capstone.html#sec-estimation-roadmap){.walkthrough-link target="_blank"}
:::

## One Dataset Keeps the Models Comparable {#data}

The rebel-cooperation network supplies:

- 30 armed organizations active in the Syrian civil war
- An undirected tie for at least one claimed tactical joint operation, July 2012 through June 2015
- Organization ideology and size
- Pair-level ideological distance, power difference, shared location, and shared sponsor
- Strong differences in how many cooperation partners organizations have

::: {.say-it}
Every lens sees the same observed network, but each conditions on a different representation of its dependence.
:::

::: {.slide-link}
[Inspect the common data](day14_capstone.html#sec-data){.walkthrough-link target="_blank"}
:::

::: {.notes}
Rebuild the netify object and state the outcome, actor roster, direction, and missingness rule. Emphasize that the paper models the square root of the number of claimed joint operations, while this capstone binarizes the count to any versus none.
:::

## Lens 0: Start With the Dyadic GLM {#glm}

:::: {.comparison-row}
::: {.comparison-card}
[What it asks]{.card-title}

Which measured pair characteristics are associated with recorded cooperation?
:::
::: {.comparison-card .accent-card}
[What it initially assumes]{.card-title}

The usual GLM uncertainty calculation treats the 435 organization pairs as independent rows.
:::
::::

::: {.bottom-line}
The GLM gives us familiar conditional associations. Before reading its intervals, we need to account for the fact that many rows contain the same organizations.
:::

::: {.slide-link}
[Fit the dyadic GLM](day14_capstone.html#sec-glm){.walkthrough-link target="_blank"}
:::

::: {.notes}
The GLM uses one row per unordered pair and sums actor covariates across both endpoints, matching the symmetric models. Same location, ideological similarity, and combined group size are clearly associated with cooperation under the usual GLM calculation. Do not interpret the intervals yet. Use the shared organizations across rows to motivate the next slide.
:::

## What Dyadic Cluster-Robust Standard Errors Do {#dcr}

The rows in a dyadic regression overlap:

- ANF with ASIM and ANF with another organization both contain ANF.
- Unmeasured changes involving ANF can therefore affect both regression errors.

Dyadic cluster-robust standard errors, or DCRSEs, allow errors to be correlated when two dyads share either organization.

::: {.bottom-line}
DCR keeps the GLM coefficients exactly the same and recalculates only their standard errors, intervals, and tests. Here, the power-difference interval widens across zero, while several other intervals narrow.
:::

::: {.slide-link}
[See the shared-actor calculation](day14_capstone.html#sec-dcr){.walkthrough-link target="_blank"}
:::

::: {.notes}
Ordinary GLM uncertainty treats all 435 unordered pairs as independent. DCR instead permits dependence for incident dyads, meaning pairs that share either organization. It builds a sandwich covariance from the shared-actor score contributions. It does not refit the regression or create actor effects.
:::

## What DCR Does Not Fix {#dcr-caveats}

- It does not repair an omitted actor trait, a wrong functional form, or a missing network process.
- It still treats dyads with no shared organization as independent. Broader shocks or network dependence can violate that assumption.
- Its justification is asymptotic in the number of actors. With only 30 organizations, the intervals can be unstable.
- It does not turn a conditional association into a causal effect.
- A corrected standard error can be larger or smaller because the estimated shared-actor covariances can have either sign.

::: {.bottom-line}
DCR is an uncertainty correction for a declared regression, not a model of how the network formed.
:::

::: {.slide-link}
[Read the DCR caveats](day14_capstone.html#sec-dcr-caveats){.walkthrough-link target="_blank"}
:::

::: {.notes}
Carlson, Incerti, and Aronow (2024) emphasize that DCR is not a panacea. Dependence between non-incident dyads remains outside the correction, and small-sample inference is an ongoing concern. That is why the capstone compares DCR with models that change the conditional mean rather than treating them as substitutes.
:::

## Lens 1: SRM Locates Organization-Level Dependence {#srm}

$$\eta_{ij}=x_{ij}^{\mathsf T}\beta+a_i+a_j$$

Because this cooperation network is undirected, the SRM asks:

- Which organizations cooperate with more partners than the measured covariates predict?
- How much of the network's hub structure is organization-level heterogeneity?
- Which covariate results change after every organization receives an additive effect?

::: {.say-it}
ANF and ASIM have the largest fitted overall cooperation effects. The SRM reproduces the observed spread in organizations' numbers of partners without adding a separate friend-of-a-friend term.
:::

::: {.slide-link}
[Fit the SRM lens](day14_capstone.html#sec-srm){.walkthrough-link target="_blank"}
:::

::: {.notes}
The undirected application has one additive sociality effect per organization, not separate sender and receiver effects. Compare the covariate results with DCR and locate whether disagreement comes from re-estimating the mean.
:::

## Lens 2: Blockmodels Ask Whether Actors Come in Kinds {#blocks}

$$\Pr(Y_{ij}=1\mid z_i,z_j)=\theta_{z_i z_j}$$

::: {.room-prompt .compact-prompt}
Can a small number of relational roles summarize which organizations cooperate?
:::

| Role Pair | Fitted Cooperation Probability |
|---|---:|
| Core with core | 0.96 |
| Core with periphery | 0.74 |
| Periphery with periphery | 0.11 |

::: {.say-it}
The fitted roles place ANF and ASIM in a two-organization core. The hard partition leaves only one core-to-core pair. Variational EM also uses soft memberships from all dyads, but a role represented by only two organizations remains fragile. Read this as a hub-versus-periphery summary, not as two coalition communities.
:::

::: {.slide-link}
[Fit the blockmodel lens](day14_capstone.html#sec-blocks){.walkthrough-link target="_blank"}
:::

::: {.notes}
Index blocks by stable features such as size or profile, never raw label numbers. Explain why the capstone uses a simpler hard-membership comparison rather than refitting every Day 9 extension.
:::

## Lens 3: AME Adds a Relational Surface {#ame}

$$\eta_{ij}=x_{ij}^{\mathsf T}\beta+a_i+a_j+u_i^{\mathsf T}\Lambda u_j$$

The SRM gives each organization one overall cooperation effect. AME adds a pair-specific score:

- A high score raises fitted cooperation for that particular pair.
- A low score lowers fitted cooperation for that particular pair.
- The scores summarize recurring partner patterns that the measured variables and overall organization effects missed.

::: {.say-it}
Shared location remains clearly positive. The ideology-distance result becomes uncertain after the pair-specific surface is included, so the measured ideology difference and the latent partner pattern compete to explain some of the same ties.
:::

::: {.slide-link}
[Fit the AME lens](day14_capstone.html#sec-ame){.walkthrough-link target="_blank"}
:::

::: {.notes}
Shared location remains positive and power difference remains negative. Ideological distance becomes uncertain once the latent surface competes to explain the same pairs. The walkthrough displays coefficient effective sample sizes from the longer teaching chain. Keep coordinates separate from invariant fitted quantities, and use independently initialized chains for research.
:::

## Lens 4: ERGM Makes Configurations Explicit {#ergm}

$$\Pr(Y=y)\propto\exp\{\theta^{\mathsf T}g(y)\}$$

::: {.big-question}
Holding the rest of the network fixed, does a proposed tie receive greater conditional odds when it adds shared partners?
:::

Use change statistics and simulation to interpret:

- Edges and covariates
- Actor sociality and degree-related terms
- Geometrically weighted closure

::: {.slide-link}
[Fit the ERGM lens](day14_capstone.html#sec-ergm){.walkthrough-link target="_blank"}
:::

::: {.notes}
ERGM sequence: initial specification, then sociality. Apparent disagreement with AME can disappear once both models represent actor heterogeneity.
:::

## Why Hubs Can Be Mistaken for Closure {#reconcile .smaller}

ANF and ASIM cooperate with many organizations. That alone creates many pairs that share a cooperation partner, even if organizations did not choose partners through a friend-of-a-friend process.

| Specification | What the simulations show |
|---|---|
| Covariates plus shared partners | Simulations have too little variation in partner counts and too much transitivity |
| Add one curved degree term | Improves AIC, but the observed values remain outside both simulation intervals |
| Give each organization its own baseline activity | The two observed values fall inside their simulation intervals; the remaining shared-partner coefficient interval includes zero |

::: {.say-it}
Within the final, highly flexible specification, the remaining shared-partner association is imprecise and the two selected simulation checks do not reveal a mismatch. Do not compare the shared-partner coefficients across specifications as though they estimated the same effect.
:::

::: {.mini-caution}
With 29 sociality parameters and only 85 ties, matching degree heterogeneity is partly built into the final model. The nodal covariates also leave when sociality enters, so this is not a one-term-at-a-time comparison.
:::

::: {.notes}
The model sequence separates two patterns that can look alike. A hub mechanically creates many shared partners. A shared-partner association means ties remain especially common among pairs with shared partners after other included structure is represented. The first two specifications miss both simulation checks. Read the final specification on its own. It covers the focal statistics, and its conditional shared-partner interval includes zero. This does not prove that organizations formed or avoided ties through a particular process.
:::

## Inside the Simulation Interval Is Good News, with Limits {#ergm-simulation-check .smaller}

| Final sociality ERGM | Observed | Simulated median | 95% simulation interval |
|---|---:|---:|---:|
| Variation in organizations' partner rates | 0.184 | 0.190 | [0.172, 0.207] |
| Centered transitivity dependence | 0.007 | -0.018 | [-0.075, 0.061] |

Both observed values are inside their intervals. For these two checks, the simulations do not reveal a mismatch. The median shows where a typical simulated network lands.

::: {.mini-caution}
This does not establish overall fit. We checked only two summaries with 200 simulations. Each row has its own interval; this is not one simultaneous band across every diagnostic. The negative transitivity values are possible because this is a centered dependence score, not a triangle count.
:::

::: {.notes}
The first two ERGMs fail clearly. In both, observed actor heterogeneity is above the simulation interval and observed centered transitivity is below it. The sociality model covers both. That is the right interpretation of the interval. It supports this narrow check, not a declaration that the whole model is correct. In research, use more simulations, inspect the native degree, shared-partner, distance, component, isolate, and mixing diagnostics, and examine other decay values. The fixed decay of 0.5 is a teaching convention.
:::

## What Did Each Model Help Us Learn? {#payoff .smaller}

| Lens | What it added | Main result in this network |
|---|---|---|
| GLM + DCR | Measured pair traits with shared-actor uncertainty | Location, ideology, and combined group size remain associated with cooperation |
| SRM | One overall cooperation tendency per organization | ANF and ASIM account for much of the hub structure |
| Blockmodel | Discrete partner-list types | A small two-organization core and a heterogeneous periphery |
| AME | Continuous pair-specific structure | Shared location remains; the ideology interval includes zero |
| ERGM | Explicit shared-partner structure | After organization-specific activity enters, the shared-partner interval includes zero and simulations reproduce both focal patterns |

::: {.bottom-line}
The models reveal different parts of the same network because they ask different questions.
:::

::: {.slide-link}
[Read the model comparison](day14_capstone.html#sec-comparison){.walkthrough-link target="_blank"}
:::

::: {.notes}
For every row, ask what the model tried to explain, what feature it added, what it revealed, and which result would make us stop trusting it. The rows are not contestants pursuing one identical target.
:::

## After Naming the Target, Preserve the Data Structure {#framework}

:::: {.metric-row}
::: {.metric-card}
[One snapshot]{.metric-label}

**Cross-sectional**

GLM/DCR, SRM, blocks, AME, ERGM
:::
::: {.metric-card}
[Panel waves]{.metric-label}

**Longitudinal**

TERGM, SAOM, dynamic latent models
:::
::: {.metric-card}
[Treatment spills over]{.metric-label}

**Causal design**

Day 13's exposure and comparison logic
:::
::::

::: {.slide-link}
[Use the decision framework](day14_capstone.html#sec-framework){.walkthrough-link target="_blank"}
:::

::: {.notes}
The estimand comes first. Next, preserve what was observed rather than forcing it into a familiar format. A snapshot, a panel, and a spillover design support different questions and require different assumptions. Multilayer data enter later as a frontier extension, not as a tool students were already expected to know.
:::

## Choose a Model in Three Steps {#rule}

::: {.final-claim}
Start with what you want to learn, not with the package you want to use.
:::

1. **Say the question in ordinary language.** Example: Which organizations cooperate unusually widely?
2. **Choose the model feature that answers it.** An SRM gives each organization its own overall cooperation tendency.
3. **Name the check that could change your mind.** If the SRM still misses important partner patterns, add a blockmodel, AME surface, or explicit ERGM configuration depending on the miss.

::: {.bottom-line}
The next model should address a specific problem that the first model left behind.
:::

::: {.notes}
Walk through the example literally. If the question is broad organizational activity, start with the SRM. If simulated networks still miss recurring partner types, try blocks. If they miss smooth pair-specific compatibility, try AME. If the theory names a configuration such as shared partners, try an ERGM and check it through simulation. Model expansion should follow a visible miss or a different research question.
:::

## Four Studies, Four Lessons We Can Reuse {#causal-lessons .smaller}

| Study | What happened | Lesson for our research |
|---|---|---|
| Voting message | A message sent to one voter also raised turnout for the other voter in the household | An intervention can reach people who were not directly treated |
| School anti-conflict program | Selected students were invited to lead an anti-conflict program, and their friends could be exposed without receiving an invitation | A student's own assignment, exposure through assigned peers, and the wider program-school context are different |
| Ghana election observers | Observers monitored voter-registration centers to deter manipulation. Registration growth fell at monitored centers and rose at nearby unmonitored centers | An intervention may move behavior somewhere else |
| Friends' GPA | A large peer association became much smaller after double-negative-control adjustment under additional assumptions | Similar friends do not by themselves show peer influence |

::: {.bottom-line}
For our own studies, ask where an effect can travel, where behavior can move, and why connected units already resemble one another.
:::

## Carry Six Questions From the Causal Lecture {#observational-guide}

1. **What changes?** Name the treatment or exposure precisely.
2. **Whose outcome may change, and when?**
3. **Compared with what?** Name the units or periods supplying the comparison.
4. **Why might treated and untreated cases already differ?**
5. **Can treatment reach a unit through its network neighbors?**
6. **Which result would still be useful if a causal claim is not credible?**

::: {.bottom-line}
Do this before choosing a network model. A sophisticated dependence model cannot repair a comparison that never identified the effect.
:::

::: {.slide-link}
[Apply the observational research checklist](day14_capstone.html#sec-observational-guide){.walkthrough-link target="_blank"}
:::

## Turn the Questions Into a Workable Analysis {#observational-modeling}

**Example: Do sanctions reduce later trade?**

- Define the treatment as a sanction imposed before the trade outcome.
- Compare sanctioned and unsanctioned pair-periods with similar pre-treatment histories.
- Measure pre-sanction trade, security relations, regime ties, and economic conditions.
- If allies' sanctions may alter the focal pair's trade, define that indirect exposure.
- Use pre-treatment outcomes or negative controls to probe hidden selection.
- Model repeated states and dyads, but keep that dependence problem separate from causal identification.

::: {.bottom-line}
If the conditions producing sanctions may also reduce trade, report an association and name that remaining threat.
:::

::: {.slide-link}
[See IR and comparative examples](day14_capstone.html#sec-observational-modeling){.walkthrough-link target="_blank"}
:::

::: {.notes}
The same workflow applies to election monitoring, alliance commitments, protest diffusion, policy emulation, and conflict spillovers. First build a credible comparison. Then choose a model that respects repeated actors, time, and network exposure. Latent positions can proxy hidden selection only when the network contains a recoverable footprint of the omitted traits. They can help, but they do not supply identification by themselves.
:::

## A Negative Control Starts as a Deliberate Non-Effect {#negative-control}

Egami and Tchetgen Tchetgen (2024) ask whether students do better academically when their friends have higher GPAs.

**Main exposure:** friends' average baseline GPA  
**Outcome:** the student's later GPA  
**Confounding worry:** friends may share motivation, family resources, courses, stress, or school conditions before any influence occurs

Friends' baseline headaches may reflect that hidden background, but should not directly change the student's later GPA. As a basic placebo check, an association between friends' headaches and later GPA would warn that hidden selection may remain.

::: {.notes}
The headaches are not the outcome the researchers care about. A basic negative control asks whether the design finds a relationship where the proposed peer-GPA mechanism says there should not be one. A failed check can reveal bias. A passed check cannot rule out every confounder.
:::

## Their Method Uses Two Controls to Adjust, Not Just Diagnose {.smaller}

| Role | Variable | Required idea |
|---|---|
| Negative-control exposure | Friends' headaches, or peers-of-peers' GPA in the alternative analysis | Carries information about hidden selection but has no direct effect on the student's baseline or later GPA after the stated conditioning |
| Negative-control outcome | Student's own baseline GPA | Carries information about the same hidden background but cannot be changed by friends' baseline GPA under the timing assumption |

Egami and Tchetgen Tchetgen use the pair to estimate a **confounding bridge** with GMM. Under additional exclusion, relevance, completeness, and bridge assumptions, that bridge adjusts the peer-GPA estimate.

::: {.bottom-line}
The correction is not “put headaches into the regression.” Two negative controls supply proxy information about hidden confounding, and a specialized estimator uses that information.
:::

::: {.notes}
The distinction to repeat is diagnostic versus adjustment. A placebo-style negative control detects a warning. Their double-negative-control method pairs an exposure control with an outcome control and estimates a bridge that can adjust the focal contrast under stronger assumptions. The paper also uses peers-of-peers' GPA as an alternative exposure control. The headache-based proxy relationship is weaker, which is why that estimate has a wide interval.
:::

## The Frontier: Predicting Cooperation From Network Position {#node2vec .smaller}

**Question:** Can walk-based coordinates recover hidden cooperation ties better than simple network summaries?

Across 30 repeated splits, we hide 17 cooperation ties and 17 non-ties before constructing any features.

| Predictors | Mean held-out AUC |
|---|---:|
| Degree and shared-neighbor summaries | **0.82** |
| Node2vec-style walk coordinates | 0.60 |
| Both together | 0.80 |

::: {.say-it}
AUC is 0.50 for chance ranking and 1.00 for perfect ranking. In this small, hub-dominated network, the embedding does not beat the simple baseline.
:::

::: {.mini-caution}
The teaching code uses node2vec's biased walks, then compresses the resulting neighborhood table with PPMI and SVD. It demonstrates the walk-embedding idea but is not the original skip-gram implementation.
:::

::: {.slide-link}
[See the cooperation example](day14_capstone.html#sec-node2vec){.walkthrough-link target="_blank"}
:::

::: {.notes}
This uses the same 30-organization Syrian cooperation network as the fitted capstone comparison. The test ties are removed before the features are built. The result is not a failed demonstration. It is the point of evaluation: a complex representation has to beat degree and shared-neighbor summaries before it earns a place in the analysis.
:::

## What Node2vec Does With the Network {#node2vec-estimation}

1. Reserve ties and non-ties for testing, then remove the test ties from the graph.
2. Start at one organization and follow a few observed ties.
3. Repeat these short network trips from every organization.
4. Give every organization a short row of coordinates. Organizations reached in similar network neighborhoods receive similar rows.
5. Combine two organizations' profiles, fit a model on visible pairs, and test it on hidden pairs.

::: {.mini-caution}
The trips are created by the computer. They are not organizations moving through the conflict.
:::

::: {.bottom-line}
The numbers are coordinates in an embedding space, much like factor scores. We use their relative positions for prediction, but an individual axis does not automatically mean ideology, power, or influence.
:::

::: {.notes}
No knowledge of text analysis is needed. The historical link is simply that node2vec borrowed a successful machine-learning trick for learning from repeated contexts. In a network, those contexts come from short computer-generated trips along observed ties.
:::

## Three Methods, Three Definitions of “Similar” {#node2vec-ml-road}

| Method | The question used to place actors near one another |
|---|---|
| DeepWalk (Perozzi et al. 2014) | Do ordinary short walks repeatedly encounter these actors in similar contexts? |
| LINE (Tang et al. 2015) | Are the actors directly connected, or do they have similar immediate neighbor lists? |
| Node2vec (Grover and Leskovec 2016) | Should similarity emphasize the same local neighborhood or a similar role elsewhere in the graph? |

::: {.bottom-line}
All three return a short coordinate row for each actor. They differ in which network evidence makes two rows similar.
:::

::: {.slide-link}
[See how the methods connect](day14_capstone.html#sec-node2vec-ml-road){.walkthrough-link target="_blank"}
:::

::: {.notes}
DeepWalk uses ordinary walks. LINE emphasizes observed ties and immediate neighbor patterns. Node2vec lets the analyst tune walks toward local community membership or toward similar roles in different regions. For the Syrian network, that could distinguish organizations in the same coalition neighborhood from hubs occupying similar positions in different neighborhoods.
:::

## NetMF and GraphSAGE Solve Two Practical Problems {#node2vec-ml-road-2}

:::: {.comparison-row}
::: {.comparison-card}
[NetMF: What Is Being Compressed?]{.card-title}

First build a table. Row $i$, column $j$ records how often walks from actor $i$ reach actor $j$, relative to chance.

Actors with similar rows have similar sampled neighborhoods. SVD compresses each long row into a few coordinates.
:::
::: {.comparison-card .accent-card}
[GraphSAGE: What About a New Actor?]{.card-title}

Node2vec stores coordinates for the actors used in training. A new actor has no stored row.

GraphSAGE learns a recipe using an actor's traits and neighbors. Apply that recipe to construct coordinates for a new actor.
:::
::::

::: {.bottom-line}
NetMF makes the neighborhood table visible. GraphSAGE learns a reusable coordinate-making recipe.
:::

::: {.slide-link}
[See the matrix and new-actor connections](day14_capstone.html#sec-node2vec-ml-road){.walkthrough-link target="_blank"}
:::

::: {.notes}
Qiu et al. provide the clean bridge to the factor-model intuition. The implicit matrix contains transformed node-context co-occurrences from the walk procedure, not simply observed ties. GraphSAGE is useful when future data contain actors that were not in the training network, but prediction for new actors still requires observed attributes and a neighborhood from which to construct their features.
:::

## Question 1: Can We Predict a Hidden Tie? {#node2vec-link-prediction}

**Syrian cooperation example**

1. Before learning coordinates, reserve some cooperation ties and an appropriate sample of non-ties.
2. Remove the reserved ties, then learn the walk-based coordinates from the reduced graph.
3. Turn each candidate pair into predictors using the two organizations' coordinates.
4. Fit on the remaining pairs and predict only the pairs hidden in step 1.
5. Compare with degree and shared-partner baselines. In a full application, also add observed pair characteristics.

::: {.bottom-line}
A useful result would be: network coordinates improve prediction of held-back cooperation ties beyond the baselines. It would not tell us why those ties formed.
:::

::: {.notes}
The order prevents leakage. If a held-back tie remains in the graph used to learn coordinates, the feature construction has already seen part of the answer. Accuracy alone can also mislead in a sparse network, so compare ranking measures such as area under the ROC curve or precision among the highest-scored pairs and report the non-tie sampling rule.
:::

## Question 2: Can Network Position Predict an Actor Label? {#node2vec-label-prediction}

Brown et al. (2021) use linking patterns to help predict ideological labels for Twitter users and internet domains.

- The outcome belongs to an **actor**, not a pair.
- The predictors summarize which other actors or domains link to it.
- Keep test actors in the graph, but hide their labels from the classifier.
- Compare network features with a simple label-frequency baseline and with useful non-network attributes.
- Check whether performance survives across different samples, platforms, or time periods.

::: {.bottom-line}
The warranted claim is predictive: actors' link neighborhoods contain information about the held-out labels. The coordinates do not become an ideology scale automatically.
:::

::: {.notes}
Make the unit change explicit. Hidden-tie prediction holds out dyads before constructing network features. Transductive actor-label prediction keeps test actors in the graph so node2vec can embed them, but hides their labels while training the classifier. Removing the actors entirely would be the separate inductive GraphSAGE task on the next slide. Avoid leakage from labels or links collected after the outcome period.
:::

## Question 3: Can We Build Features for a New Actor? {#node2vec-new-actors}

Ordinary node2vec learns a separate coordinate row for every actor in the training graph. A genuinely new actor has no stored row.

GraphSAGE instead learns a rule:

1. Start with the new actor's observed attributes.
2. summarize the attributes of its observed neighbors;
3. combine those summaries using the learned rule;
4. produce coordinates for the new actor;
5. use those coordinates in the prediction task.

::: {.bottom-line}
Test on actors or later periods excluded from training. The method still needs observed attributes and enough neighborhood information for the new actor.
:::

::: {.slide-link}
[See how the three prediction tasks differ](day14_capstone.html#sec-node2vec-applications){.walkthrough-link target="_blank"}
:::

::: {.notes}
This is called an inductive task because the test actor was absent while the rule was learned. Holding out random dyads is not enough to demonstrate new-actor performance. Hold out complete actors or train on earlier periods and test on actors appearing later. GraphSAGE can construct features only from information available at prediction time.
:::

## Node2vec and Day 10 Are Cousins {#node2vec-lfm}

| | Node2vec and related graph ML | Latent factor model or AME |
|---|---|---|
| Main goal | Build useful features for prediction | Explain a declared dyadic outcome |
| What gets compressed | Network neighborhoods | Unexplained patterns in the outcome |
| What we check | Performance on genuinely hidden cases | Uncertainty, prediction, and network fit |

Both approaches reduce complicated relational patterns to a few numbers per actor. They do that for different reasons.

::: {.bottom-line}
If node2vec improves hidden-tie prediction, say exactly that. Do not rename an axis "ideology," "influence," or "alliance" without outside evidence.
:::

::: {.slide-link}
[Compare node2vec with latent factor models](day14_capstone.html#sec-node2vec-lfm){.walkthrough-link target="_blank"}
:::

::: {.notes}
Day 10 used a movie example to show how a large table can be approximated with a small number of latent dimensions. Node2vec has the same compression intuition, but it compresses a table produced from network neighborhoods. AME models the dyadic outcome directly, can include measured predictors and actor effects, and supports model-based uncertainty and goodness-of-fit. Similar mathematics does not make the research claims interchangeable.
:::

## SIR Asks How Conflict Patterns Carry Forward {#sir}

Minhas and Hoff (2026) study monthly **material-conflict events among countries**. These include physical attacks, destruction of property, and other coercive actions recorded by ICEWS.

The model separates two questions:

- **Direct dyadic history:** Does state $i$ direct more conflict toward state $j$ after earlier conflict within that same pair?
- **Network influence:** Does conflict elsewhere in the system help predict which states $i$ targets next and which states $j$ is targeted by next?

::: {.bottom-line}
Here, influence means a lagged predictive association. It does not by itself show imitation, coordination, or a causal effect.
:::

::: {.slide-link}
[Open the influence application](day14_capstone.html#sec-frontier-sir){.walkthrough-link target="_blank"}
:::

## Direct Effects and Influence Paths Are Different

**Direct part of the model**

- The pair's earlier conflict and conflict in the reverse direction
- Geographic distance, joint democracy, alliance, trade, and verbal cooperation

**Influence part of the model**

- **Sender side:** Does state $i$ target countries that its allies or verbal-cooperation partners targeted previously?
- **Receiver side:** Are geographically nearby states targeted by similar sets of countries?

::: {.bottom-line}
The direct terms describe one state pair's history. The influence terms ask whether other relationships help predict that pair's next outcome.
:::

## What the Published SIR Application Finds

**Alliances organize sender-side influence**

States tend to direct more material-conflict events toward countries that their allies fought in the previous month.

**Verbal cooperation also organizes sender-side influence**

States tend to target some of the same countries as their cooperative diplomatic partners.

**Geography organizes receiver-side influence**

Nearby states tend to receive conflict from similar sets of senders.

::: {.mini-caution}
These are conditional temporal patterns. The model does not establish that allies coordinated, that one state copied another, or that proximity caused conflict.
:::

## The Same Modeling Move Can Structure Different Objects {#sir-covariates}

| Model | Hidden object | What observed covariates do |
|---|---|---|
| NetMix | An actor-year's mixture of discrete relational roles | Nodal covariates can predict which role mixture an actor-year tends to occupy |
| Austin et al. (2013) | A continuous latent social position | Nodal covariates define the expected position; a random residual lets actors depart from it |
| SIR | A directed channel of influence over time | Observed relational matrices define possible channels; estimated weights show which channels carry the lagged association |

::: {.bottom-line}
The shared idea is to make a hidden relational object partly explainable by observed variables. The hidden object is different in each model.
:::

::: {.slide-link}
[Compare the three covariate-defined structures](day14_capstone.html#sec-sir-covariates){.walkthrough-link target="_blank"}
:::

::: {.notes}
In NetMix, `formula.monad` links nodal attributes to mixed-membership weights. Austin, Linkletter, and Wu regress latent positions on nodal covariates, which can help predict positions for actors entering the network when their covariates are known. SIR parameterizes its sender-side and receiver-side influence matrices as weighted combinations of observed relational matrices. None of these turns a latent object into a directly observed trait, and their coefficients answer different questions.
:::

## How SIR Is Estimated {#sir-estimation .smaller}

For monthly conflict counts,

$$
\eta_{ijt}=z_{ijt}^{\mathsf T}\theta+\left(A X_{t-1}B^{\mathsf T}\right)_{ij},
\qquad
A=\sum_r\alpha_rW_r,\qquad B=\sum_r\beta_rW_r.
$$

- $z_{ijt}^{\mathsf T}\theta$ contains the direct dyadic predictors.
- $X_{t-1}$ is the previous month's conflict network.
- $A$ describes sender-side channels; $B$ describes receiver-side channels.

The Poisson estimator alternates two familiar jobs:

1. Hold the receiver side fixed and update the direct and sender-side coefficients.
2. Hold the sender side fixed and update the receiver-side coefficients.
3. Repeat until the fitted likelihood and coefficients stabilize.

::: {.mini-caution}
Instead of estimating one unrestricted influence parameter for every country pair, SIR learns which observed relationships carry the lagged association.
:::

::: {.slide-link}
[See how SIR is estimated and checked](day14_capstone.html#sec-sir-estimation){.walkthrough-link target="_blank"}
:::

::: {.notes}
The full Poisson likelihood appears in the walkthrough. The alternating engine normalizes alpha-1 to 1 for reporting, while the channel matrix C and fitted means remain invariant. The default sandwich clusters score contributions by both endpoint actors, not by time period.
:::

## Multilayer Networks Keep Several Relations Visible {#layer-index}

For the same source $i$ and target $j$,

$$
Y_{ij\ell}
$$

keeps relation type $\ell$ visible. With repeated years, the object becomes $Y_{ij\ell t}$.

Examples include:

- Military threats, sanctions, trade, and alliances among the same states
- Verbal cooperation, material cooperation, verbal conflict, and material conflict
- Advice, friendship, and collaboration among the same people

::: {.bottom-line}
A multilayer question asks whether the same actors and dyads play similar or different roles across relations.
:::

::: {.slide-link}
[Keep the layer index visible](day14_capstone.html#sec-layer-index){.walkthrough-link target="_blank"}
:::

::: {.notes}
Do not begin with tensor notation. Begin with the applied reason for keeping several relations visible: a state can cooperate economically, oppose another state diplomatically, and threaten it militarily during the same period. The layer index prevents those actions from becoming one undifferentiated tie.
:::

## Theory Can Make the Layers Interdependent {#layer-theory}

With repeated observations, $Y_{ij\ell t}$ can represent several relations evolving together.

- **International relations:** Conflict can reduce trade, while trade dependence may discourage later conflict.
- **American politics:** Legislative cosponsorship can build voting coalitions, while repeated voting agreement can make future cosponsorship easier.
- **Education:** Friendship can create opportunities for study help, while repeated help can strengthen a friendship.

::: {.bottom-line}
A multilayer design is useful when two relations may shape one another. Repeated observations help establish sequence, but they do not by themselves establish causation.
:::

::: {.slide-link}
[Develop a multilayer research question](day14_capstone.html#sec-layer-theory){.walkthrough-link target="_blank"}
:::

::: {.notes}
Walk through the feedback in each example. Trade and conflict, cosponsorship and voting agreement, and friendship and study help can each move in both directions. A joint model can represent the relations together and test whether their histories improve prediction across layers. A causal direction still requires stronger assumptions or a design.
:::

## What `netify` Can Do With the Layers {#layer-netify}

| Task | Function |
|---|---|
| Combine aligned network objects and keep the layer labels | `layer_netify()` |
| Verify and summarize the object | `is_multilayer()`, `n_layers()`, `summary()` |
| Extract one relation or its matrix | `subset(..., layers = )`, `as.matrix(..., layer = )` |
| Compare ties or attributes across layers | `compare_networks()` |
| Draw all layers with a common data structure | `plot()` |

::: {.bottom-line}
`netify` handles construction, validation, extraction, comparison, and visualization. The substantive question still determines whether layers should be modeled jointly.
:::

::: {.slide-link}
[Use the multilayer helpers](day14_capstone.html#sec-layer-netify){.walkthrough-link target="_blank"}
:::

::: {.notes}
The common actor order and explicit layer labels prevent silent mismatches. `compare_networks()` supports correlations and binary overlap measures, with optional permutation tests. A layer can be extracted for a layer-specific model, while the aligned object can be converted to the array needed for a joint model.
:::

## One Network Can Contain Four Different Stories {#layer-visual}

![](icews_multilayer_example.png){fig-alt="Four network panels show the same twelve states in fixed positions, with different directed ties for verbal cooperation, material cooperation, verbal conflict, and material conflict." width="64%" fig-align="center"}

::: {.mini-caution}
ICEWS, 2010. The same 12 states appear in fixed positions, and each panel shows its 12 highest-volume directed pairs. Keeping the layers separate reveals changing partner patterns that an aggregated "any interaction" network would hide.
:::

::: {.notes}
Keep the node locations fixed while reading across panels. That makes the comparison about changing ties, not a changing layout. Verbal cooperation is strongly centered on the United States in this high-activity subset, material cooperation includes a different set of prominent links, and the conflict panels shift again. Because each panel displays its own top 12 dyads, compare partner patterns rather than raw density.
:::

## Do Not Flatten Away the Question {#layer-measurement}

Collapsing verbal cooperation, material cooperation, verbal conflict, and material conflict into "any interaction" changes the outcome.

Fitting four separate networks preserves the outcomes but cannot estimate:

- A source profile shared across relations
- A target profile shared across relations
- Which layers express the same relational component
- Shared cross-layer mean structure

::: {.say-it}
Keep the layer index when the question concerns whether the same dyadic pattern appears in several kinds of interaction.
:::

::: {.slide-link}
[See the four ICEWS layers](day14_capstone.html#sec-layer-visual){.walkthrough-link target="_blank"}
:::

::: {.notes}
Flattening answers whether any recorded interaction occurred. That may be a legitimate outcome, but it cannot answer whether cooperation and conflict share a dyadic profile. Separate fits preserve the labels but do not estimate one relational mean structure shared across layers.
:::

## Follow One Shared Component Across the Layers {#tensor-intuition}

For component $r$, the contribution to one source-target-layer cell is

$$
u_{ir}\times v_{jr}\times w_{\ell r}.
$$

1. $u_{ir}$ says how strongly source $i$ expresses the source side of this profile.
2. $v_{jr}$ says how strongly target $j$ expresses the target side.
3. Their product identifies source-target pairs matching the profile.
4. $w_{\ell r}$ says whether that same pair pattern is strong, weak, reversed, or absent in layer $\ell$.

::: {.bottom-line}
One component can describe the same recurring set of dyads across all four relations while allowing conflict to express it more strongly than cooperation.
:::

::: {.notes}
Use the fitted application as the example. One component emphasizes high-activity dyads involving the United States. A second emphasizes a Middle East set involving Iran, Israel, Lebanon, Egypt, and Iraq. Both recur strongly across cooperation and conflict. The model did not find one pure cooperation component and one pure conflict component.
:::

## A Joint Multilinear Model Shares Actor Profiles {#tensor-model .smaller}

$$
\eta_{ij\ell}
=x_{ij\ell}^{\mathsf T}\beta_\ell
+a_{i\ell}+b_{j\ell}
+\sum_{r=1}^{R}u_{ir}v_{jr}w_{\ell r}.
$$

- $\beta_\ell$: relation-specific measured associations
- $a_{i\ell},b_{j\ell}$: layer-specific source activity and target exposure
- $u_{ir},v_{jr}$: source and target profiles shared across layers
- $w_{\ell r}$: how strongly layer $\ell$ expresses component $r$

The full model can include $x_{ij\ell}^{\mathsf T}\beta_\ell$. The teaching fit below omits that block and models separately standardized $\log(1+\text{count})$ layers.

::: {.bottom-line}
Separate fits can find a different factor surface in each layer, but they do not estimate one shared $U,V$ profile or the layer weights $W$ that reveal where it recurs.
:::

::: {.slide-link}
[Read the joint model](day14_capstone.html#sec-tensor-model){.walkthrough-link target="_blank"}
:::

::: {.notes}
Walk left to right. The measured associations and additive source and target effects are layer-specific. The shared U and V profiles identify recurring source-target patterns across relations. W changes the size and sign of each shared pattern by layer. The sum over r allows several recurring patterns at once. A binary model applies a logit link to eta, a count model uses a log link, and the Gaussian teaching fit models transformed event volumes directly.
:::

## What the Tensor Estimator Optimizes {#tensor-estimation}

This teaching fit uses the same broad ALS logic as `lame`. For the transformed Gaussian outcome, it minimizes

$$
\min \sum_{i\ne j,\ell}
\left(Y^*_{ij\ell}-\eta_{ij\ell}\right)^2.
$$

1. Remove the current layer-specific source and target effects.
2. Hold $V,W$ fixed and solve an ordinary least-squares update for $U$.
3. Cycle through analogous updates for $V$ and $W$, then refresh the additive effects.
4. Repeat to convergence. This example compares eight starts; research should use more starts and compare ranks out of sample.

::: {.mini-caution}
Unlike ERGM pseudolikelihood, these are conditional updates of one joint squared-error objective. The objective is nonconvex, so different starts can reach different solutions. This fast fit does not provide posterior uncertainty.
:::

::: {.slide-link}
[Open the reproducible rank-2 fit](day14_capstone.html#sec-tensor-result){.walkthrough-link target="_blank"}
:::

::: {.notes}
Connect directly to `lame`: hold the other factor blocks fixed, solve a familiar regression, and cycle. The implementation uses a small ridge term and short additive updates, so describe the blocks as being updated to reduce the joint objective rather than claiming exact unpenalized minimization at every substep. This differs from ERGM maximum pseudolikelihood, which replaces the graph likelihood with a product of conditional tie contributions. Binary and count tensor models require a matching link and likelihood rather than this Gaussian squared-error objective.
:::

## Overlap Needs a Density Benchmark {#layer-overlap}

| Layer Pair | Threshold | Jaccard | Overlap Lift |
|---|---:|---:|---:|
| Verbal conflict with material conflict | At least 1 event | 0.385 | 4.91 |
| Verbal conflict with material conflict | At least 5 events | 0.402 | 16.39 |

At the one-event threshold:

- **Jaccard 0.385:** 38.5% of dyads appearing in either conflict layer appear in both.
- **Lift 4.91:** a dyad appears in both layers 4.91 times as often as independent layers with these densities would predict.

::: {.say-it}
At five events, the overlap remains about 40%, while lift rises because high-volume dyads are rare. The result is robust to this threshold change, but it does not tell us which layer came first.
:::

::: {.notes}
Jaccard uses the union as its denominator. Lift uses an independence benchmark based on the two marginal densities. Explain why rare high-volume ties can have a similar Jaccard but much larger lift. The benchmark still ignores shared actor activity and other network structure, so it is a first descriptive null, not the final model.
:::

## What Should We Do After Finding Layer Overlap? {#layer-overlap-next}

1. **Check measurement choices.** Repeat the comparison across meaningful event thresholds and coding rules.
2. **Use a stronger null.** Ask whether overlap remains after preserving actor activity, time patterns, or other obvious sources of co-occurrence.
3. **Match the model to the claim.** Use a joint factor model for shared profiles; use repeated layers and lags for cross-layer prediction.
4. **Check what remains unexplained.** Compare held-out prediction and residual degree, triad, and cross-layer overlap patterns.

::: {.bottom-line}
Overlap is evidence that the layers are related. Theory and time ordering determine whether the next step is a joint description, a dynamic model, or a causal design.
:::

## Do the Same State Pairs Stand Out Across Relations? {#tensor-result}

First remove each state's broad source and target activity within every layer. Then ask whether a few recurring **pair patterns** explain what remains.

**Pattern 1**

After removing the United States' overall source and target activity, particular United States dyads remain unusually active across several relations.

**Pattern 2**

Pairs involving Iran, Israel, Lebanon, Egypt, and Iraq repeatedly stand out.

Both patterns appear in verbal cooperation, material cooperation, verbal conflict, and material conflict. Together they account for about 23% of the transformed variation left after the broad actor effects.

::: {.bottom-line}
The useful finding is not “two components.” It is that some state pairs remain unusually active across several different relations. The United States-centered pattern refers to unusually active pairs, not simply to high United States activity overall.
:::

::: {.notes}
Explain the job before the numbers. Separate models can tell us which pairs stand out within each relation. The joint model asks whether the same pair pattern repeats across relations. Here, a United States-centered pattern and a Middle East-centered pattern recur across both cooperation and conflict. The 23% is a reduction in squared residual variation after additive effects, not an R-squared for raw event counts. Keep the result descriptive because this is a rank-2 in-sample point fit without parameter intervals.
:::

## How Should We Check the Joint Fit? {#tensor-next}

- Compare rank 1, rank 2, and higher ranks on held-out actor-pair-layer cells.
- Repeat ALS from several starts and retain solutions reaching the best objective.
- Add defensible covariates and see whether the shared profiles remain.
- Check residual source activity, target exposure, triads, and cross-layer overlap.
- Use a binary or count likelihood when that matches the outcome, and use bootstrap or Bayesian fitting when uncertainty is required.

::: {.bottom-line}
The current fit shows a useful shared pattern. These checks determine whether it is stable enough to support a research claim.
:::

## Scaling Shortcuts Change the Statistical Job {#scale .smaller}

| Procedure | Faster route used in this course | What the shortcut does not supply |
|---|---|---|
| `lame` and tensor point fits | ALS block-coordinate updates | A posterior distribution; protection from local optima |
| Capstone ERGM | MCMC maximum likelihood | Cheap computation or guaranteed simulation mixing |
| TERGM with `btergm` | MPLE plus a temporal bootstrap | Exact graph-likelihood estimation |
| Blockmodels | Variational EM | Exact posterior exploration |
| Bayesian AME | MCMC posterior sampling | Cheap computation or guaranteed chain mixing |
| Graph embeddings | Sampled walks and negative examples | A likelihood for the original tie outcome |

::: {.say-it}
Ask what the procedure optimizes, what information it samples or approximates, and whether the resulting uncertainty matches the claim.
:::

::: {.slide-link}
[Open the scale discussion](day14_capstone.html#sec-scale){.walkthrough-link target="_blank"}
:::

::: {.notes}
ALS cycles through familiar conditional regression or penalized-regression updates inside one nonconvex objective. The capstone ERGM uses simulated networks to approximate the graph-likelihood score. `btergm` instead uses maximum pseudolikelihood and a temporal bootstrap. Variational EM optimizes a lower bound. Bayesian AME samples a posterior and can mix slowly. Negative sampling trains a prediction objective. The route must match the intended claim and diagnostic.
:::

## Write the Model Choice as an Argument {#argument}

Use this paragraph structure:

1. **Question:** Name the estimand.
2. **Data:** State the network, time, and eligibility structure.
3. **Primary model:** Explain where it represents dependence.
4. **Runner-up:** Name the strongest alternative representation.
5. **Flip condition:** Give a specific diagnostic that would change the choice.
6. **Claim:** State what the fitted result would and would not establish.

::: {.notes}
Short project draft here. A model choice becomes defensible when someone else can see what evidence would overturn it.
:::

## Published Example: With Whom Do Syrian Rebels Cooperate? {#published-choice-1}

Gade et al. (2019) ask why armed organizations chose some partners rather than others during the Syrian civil war.

**Data:** Claims of tactical joint operations from July 2012 through June 2015, combined with measures of ideology, power, state sponsorship, and shared location.

**Competing explanations:** Rebels may choose ideologically similar partners, partners of similar strength, or partners backed by the same state.

::: {.bottom-line}
This is the published study behind today's application. The paper models the square root of the number of claimed joint operations. The capstone models whether any claimed joint operation was recorded.
:::

## Work Through Their Model-Choice Argument {#published-choice-2 .smaller}

| Framework part | Application |
|---|---|
| Question | Which group differences are associated with more joint operations? |
| Primary model | AME regression, representing broad organization activity and remaining higher-order dependence |
| Model runner-up | An ERGM with the same covariates, organization heterogeneity, and any theoretically named configurations; the paper does not fit it |
| Published robustness check | Activity-constrained simulations based on observed joint-operation counts |
| Flip condition | Reconsider ideology if it disappears with shared location or if the simulations reproduce it without ideology |
| Claim | Ideologically closer groups cooperated more often; that pattern does not identify why they chose one another |

::: {.slide-link}
[Read the full published example](day14_capstone.html#sec-published-choice){.walkthrough-link target="_blank"}
:::

## What the Published Comparison Changed {#published-choice-3 .smaller}

- Ideological proximity had the clearest and most consistent association with cooperation across the AME specifications.
- Shared location also mattered, so geographic opportunity could not be ignored.
- Evidence for power similarity was weaker and less consistent.
- Shared state sponsorship did not receive clear support.
- Activity-constrained simulations also showed more ideological similarity than activity levels alone would generate.

::: {.mini-caution}
The paper's ideology result and the capstone's AME interval need not match. The outcome and conditioning set are different, so they estimate different associations.
:::

::: {.bottom-line}
The useful argument combines a substantive question, a dependence model, a simpler check, and a bounded conclusion. It does not declare one method the universal winner.
:::

## The Map, Filled In {#close-map}

<style>
#close-map .map-card:first-child { grid-column: span 1; }
</style>

:::: {.map-grid}
::: {.map-card}
[Build and describe]{.card-title}

`netify`, summaries, centrality, communities
:::
::: {.map-card .latent-card}
[Actors and latent structure]{.card-title}

SRM, blocks, latent distance, latent factors, AME
:::
::: {.map-card .model-card}
[Graph configurations]{.card-title}

ERGM and TERGM
:::
::: {.map-card .time-card}
[Actor-oriented change]{.card-title}

SAOM
:::
::: {.map-card .inference-card}
[Identification and uncertainty]{.card-title}

DCR, exposure mappings, Horvitz-Thompson estimators, negative controls
:::
::: {.map-card .frontier-card}
[Frontier tools]{.card-title}

Node2vec, tensors, SIR, multilayer models
:::
::::

::: {.bottom-line}
No cell replaces the others. Each makes a different part of relational structure explicit.
:::

::: {.slide-link}
[Return to the completed map](day14_capstone.html#sec-close){.walkthrough-link target="_blank"}
:::

::: {.notes}
Visual summary of the course. Project question: where does the project sit, and which neighboring cell contains the most serious alternative?
:::

## After the Models Run, Write the Substantive Paragraph {#after-fit}

Include the question, model choice, substantive result, diagnostic, limit, and the finding that would change the model choice.

::: {.say-it}
"ANF and ASIM cooperate with far more organizations than the rest. In the initial ERGM, ties between organizations with shared partners receive a clear positive conditional association. After every organization receives its own baseline propensity to cooperate, the shared-partner interval includes zero and the simulations cover the two selected scalar yardsticks. This saturated diagnostic does not clearly separate an additional shared-partner pattern from the hub structure. It is not evidence that closure never occurs."
:::

::: {.slide-link}
[Read the full interpretation guide](day14_capstone.html#sec-after-fit){.walkthrough-link target="_blank"}
:::

::: {.notes}
Finish with one paragraph: question, model choice, substantive pattern, diagnostic, limit, and the observation that would move the project to the runner-up.
:::

## What to Take With You {#close}

1. Define actors, ties, eligibility, missingness, and time before modeling.
2. Identify where the important variation and dependence live.
3. Match the model to the estimand rather than to a preferred software package.
4. Diagnose the feature that would change the substantive conclusion.
5. Treat latent quantities, graph statistics, temporal mechanisms, and robust standard errors as different quantities that require different interpretations.

::: {.final-claim}
The best network model is not the one that explains everything. It is the one whose question, assumptions, diagnostics, and claim you can state clearly and defend.
:::

::: {.notes}
Closing: projects, not another package. One-paragraph model-choice argument plus the diagnostic that would make it change.
:::
