Skip to contents

This function generates a discretized serial interval distribution based on the gamma distribution characterized by the specified mean and standard deviation.

Usage

generate_vector_serial(nt, mean_si, sd_si)

Arguments

nt

An integer specifying the number of time points (length of the distribution).

mean_si

A numeric value representing the mean of the serial interval distribution.

sd_si

A numeric value representing the standard deviation of the serial interval distribution.

Value

A numeric vector of length nt representing the discretized serial interval distribution.

Details

The serial interval distribution is discretized using a gamma distribution with shape and scale parameters derived from the specified mean and standard deviation. The discretization is performed by computing the difference in the cumulative distribution function (CDF) of the gamma distribution at successive integer time points.

Examples

generate_vector_serial(10, 5, 2)
#>  [1] 0.001202812 0.031215396 0.117173708 0.194349722 0.209280731 0.173135177
#>  [7] 0.120019422 0.073307035 0.040717681 0.021005459