## Create an 'SIR' model with example data.
model <- SIR(
u0 = u0_SIR(),
tspan = 1:1460,
events = events_SIR(),
beta = 0.16,
gamma = 0.077
)
## Calculate the out-degree for each node.
deg <- outdegree(model)
## View the out-degree for the first 6 nodes.
head(deg)
## Plot the distribution of out-degrees across all nodes.
## This shows how many destination nodes typically receive
## individuals from a given node.
hist(
deg,
main = "Distribution of Out-Degree (Unique Destinations)",
xlab = "Number of Unique Destination Nodes"
)
Run the code above in your browser using DataLab