# Initialize bipartite network
nw <- network.initialize(500, bipartite=250, directed=FALSE)
# Fit model with limited degree terms, but monitor wider range
est <- epiNet.est(nw,
formation = ~ edges + b1degree(0:1) + b2degree(0:1),
dissolution = ~ offset(edges),
target.stats = c(165, 100, 137.5, 120, 102.5),
coef.diss = dissolution.coefs(~ offset(edges), duration=25),
stats.form = ~ edges + b1degree(0:5) + b2degree(0:5))
# Formation plot with plots split given the 11 statistics
plot(est)
# Formation plot with plots joined, for time steps 400 to 500
plot(est, plots.joined=TRUE, dx.start=400, dx.end=500)
# Partnership duration plot
plot(est, type="duration")
# Truncate plot to start after time 200, given the age ramp up period
plot(est, type="duration", dx.start=200)
Run the code above in your browser using DataLab