30  Lab

These models run in seconds, so this lab is a menu rather than a checklist. Pick whichever path below interests you, change the one thing it names, and re-run, but predict before you watch: say what the movie should do first, then check whether it does. Keep the module’s caution in mind throughout: a single movie shows a mechanism, it does not measure an effect, so where a path asks how much, reach for replicated runs rather than one movie.

Note

A worked solution for each path is in the course repository as mod5-Lab.R. Try a path yourself before consulting it; you will get much more out of it once you have formed your own answer.

30.1 Paths to Explore

NotePick one or more

If concurrency interests you. The Concurrency and Duration tutorial set concurrent = 0. Try the other direction: set it to 30 (leaving edges at 40) and re-run. The Poisson benchmark said about 19 nodes would be concurrent by chance, so is 30 more concurrency than random mixing, or less, and does the epidemic speed up or slow down relative to the no-concurrency run? To find where the model breaks, keep pushing the target: 35, 40, 45. At 40 edges each concurrent node needs two of the 80 available degree slots, so no more than 40 nodes can be concurrent, and somewhere in there netest starts to miss the target, then fails outright. Check with netdx (wrap the fit in tryCatch so a failure does not stop you). The lesson worth taking: a mean degree can only support so much of any structure, and only netdx tells you whether it did.

If timing interests you. The tutorial used the two extremes of duration, 100,000 steps and 1 step. Fill in the middle: try 5, then 50, leaving everything else at baseline. At what point does the network stop feeling frozen and start feeling like churn? Keep in mind that “long” and “short” are relative to the 25-step horizon: the very-long and one-step runs have identical mean degree and identical edge counts at every step yet produce opposite epidemics, so much of what you are watching is timing, not structure.

If heterogeneous dissolution interests you. A minimal ~edges + nodematch("community") model (with a binary community attribute, set up as in the Network Structure tutorial) is enough to make duration depend on partnership type. Fit it with duration = c(20, 10), then swap to c(10, 20), re-run netdx, and read its two Duration rows (the edges row is the reference duration, the nodematch.community row the matched one, both mean durations in steps): how do the two rows change? Then look separately at the nodematch.community dissolution coefficient, which lives in dissolution_coefs(...)$coef.adj rather than in the netdx table: does its sign flip, and why? Then set duration = c(20, 20): what is that coefficient now, and what model have you just fit? The trap is that a swapped-but-valid model looks fine until you read the diagnostics, so trust netdx over a dissolution formula you wrote last month.

If you want to measure, not just watch. Take one change from the paths above and, instead of a single movie, run it at nsims = 200 with the same param and init, then compare the mean number infected at the final step against the baseline. Did the direction the movie suggested hold up under replication, and by how much? This is the whole difference between what a movie is good for (the mechanism) and what replicated runs are good for (the effect size), and it is why the module uses both.