Beta_mat_form: Generate an infection rate matrix.

Description Usage Arguments Value Examples

View source: R/Beta_mat_form.R

Description

This function generates a beta matrix given a distance function, values of beta, and the distances at which the infection rate changes. It works for a heterogeneous population with a near vs. far spatial kernel.

Usage

1
Beta_mat_form(dist.mat, betas, ds)

Arguments

dist.mat

An NxN matrix of the pairwise distances between individuals.

betas

A descending vector of at least length 2 of the different infection rates at each level.

ds

An acsending vector of length length(betas)-1 which contains the distances at which the infection rate changes.

Value

The function returns an NxN matrix of the pairwise infection rates between individuals.

Examples

1
2
distance_mat <- Dist_mat_unif(N=100, xlim = 20, ylim = 20)[[2]]
Beta_mat_form(distance_mat, c(0.004, 0.002), 10)

BenjamenSimon/EpidemicR documentation built on March 23, 2020, 11:03 p.m.