Learn R Programming

SimInf (version 11.1.0)

u0_SISe3: Example initial population data for the SISe3 model

Description

Dataset containing the initial number of susceptible and infected cattle (individuals) across three age categories in 1,600 herds (nodes). Provides a heterogeneous population structure for demonstrating SISe3 model simulations in a compartmental modeling context.

Usage

data(u0_SISe3)

Arguments

Format

A data.frame

Details

This dataset represents initial disease states in a synthetic population of 1,600 cattle herds (nodes) stratified into three age categories. Each row represents a single herd (node). The SISe3 model extends the SISe model with age-structured compartments (S_1, I_1, S_2, I_2, S_3, I_3) and an environmental compartment for pathogen shedding. This is appropriate for diseases where transmission rates or recovery rates differ by age group.

The data contains:

S_1

Total susceptible cattle (individuals) in age category 1 in the node

I_1

Total infected cattle in age category 1 (initialized to zero)

S_2

Total susceptible cattle in age category 2

I_2

Total infected cattle in age category 2 (initialized to zero)

S_3

Total susceptible cattle in age category 3

I_3

Total infected cattle in age category 3 (initialized to zero)

The herd size distribution and age structure is synthetically generated to reflect heterogeneity typical of large-scale populations, making it suitable for illustrating how to incorporate scheduled events in the SimInf framework.

See Also

SISe3 for creating SISe3 models with this initial state and events_SISe3 for associated cattle movement and demographic events

Examples

Run this code
## For reproducibility, call the set.seed() function and specify the
## number of threads to use. To use all available threads, remove the
## set_num_threads() call.
set.seed(123)
set_num_threads(1)

## Create an 'SISe3' model with 1600 cattle herds (nodes) stratified
## by age, initialize it to run over 4*365 days and record data at
## weekly time-points. Add ten infected animals to age category 1 in
## the first herd to seed the outbreak.  Define 'tspan' to record the
## state of the system at weekly time-points. Load scheduled events
## events for the population of nodes with births, deaths and
## between-node movements of individuals.
u0 <- u0_SISe3
u0$I_1[1] <- 10
model <- SISe3(
    u0 = u0,
    tspan = seq(from = 1, to = 4*365, by = 7),
    events = events_SISe3,
    phi = rep(0, nrow(u0)),
    upsilon_1 = 1.8e-2,
    upsilon_2 = 1.8e-2,
    upsilon_3 = 1.8e-2,
    gamma_1 = 0.1,
    gamma_2 = 0.1,
    gamma_3 = 0.1,
    alpha = 1,
    beta_t1 = 1.0e-1,
    beta_t2 = 1.0e-1,
    beta_t3 = 1.25e-1,
    beta_t4 = 1.25e-1,
    end_t1 = 91,
    end_t2 = 182,
    end_t3 = 273,
    end_t4 = 365,
    epsilon = 0
)

## Display the number of cattle affected by each event type per day.
plot(events(model))

## Run the model to generate a single stochastic trajectory.
result <- run(model)

## Plot the median and interquartile range of the number of
## susceptible and infected individuals.
plot(result)

## Plot the proportion of nodes with at least one infected individual.
plot(result, I_1 + I_2 + I_3 ~ ., level = 2, type = "l")

## Plot the trajectory for the first herd.
plot(result, index = 1)

## Summarize the trajectory. The summary includes the number of events
## by event type.
summary(result)

Run the code above in your browser using DataLab