truncate_sim: Truncate Simulation Time Series

View source: R/net.utils.R

truncate_simR Documentation

Truncate Simulation Time Series

Description

Left-truncates simulation epidemiological summary statistics and network statistics at a specified time step.

Usage

truncate_sim(x, at)

Arguments

x

Object of class netsim or icm.

at

Time step at which to left-truncate the time series.

Details

This function would be used when running a follow-up simulation from time steps b to c after a burn-in period from time a to b, where the final time window of interest for data analysis is b to c only.

Value

The updated object of class netsim or icm.

Examples

param <- param.icm(inf.prob = 0.2, act.rate = 0.25)
init <- init.icm(s.num = 500, i.num = 1)
control <- control.icm(type = "SI", nsteps = 200, nsims = 1)
mod1 <- icm(param, init, control)
df <- as.data.frame(mod1)
print(df)
plot(mod1)
mod1$control$nsteps

mod2 <- truncate_sim(mod1, at = 150)
df2 <- as.data.frame(mod2)
print(df2)
plot(mod2)
mod2$control$nsteps


EpiModel documentation built on July 9, 2023, 5:21 p.m.