make_first_layer: Initialize the tree

Description Usage Arguments Value

View source: R/sim-functions.R

Description

Creates the first layer of an infection tree.

Usage

1
make_first_layer(n_start, tbar, kappa)

Arguments

n_start

An integer greater than or equal to 1. Number of nodes in the initial layer.

tbar

A non-negative scalar. Average duration of the communicable windows of the initial nodes. Together with kappa, it determines a shape parameter tbar * kappa for the the Gamma distribution from which we draw a communicable period for each new node.

kappa

A non-negative scalar (including Inf). Rate parameter for the Gamma distribution from which we draw a communicable period duration for each new node. If kappa == Inf, then the draw is deterministic, with all communicable periods exactly equal to tbar.

Value

A tibble with one row for each new node, and five columns: id, id_parent, id_layer, t_infect, and t_comm.


pspc-data-science/branchsim documentation built on Jan. 19, 2021, 10:10 a.m.