P_mat_form: Generate an proportion of maximum infection rate matrix.

Description Usage Arguments Value Examples

View source: R/P_mat_form.R

Description

This function generates a p 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. It is essentially just a wrapper for the Beta_mat_form function, but used to calculate p.

Usage

1
P_mat_form(dist.mat, ps = 1, ds)

Arguments

dist.mat

An NxN matrix of the pairwise distances between individuals.

ps

A descending vector of at least length 2 of the different proportions of maximum infection rate at each level. The first element is assumed to be 1.

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 proportion of maximum infection rates between individuals.

Examples

1
2
distance_mat <- Dist_mat_unif(N=100, xlim = 20, ylim = 20)[[2]]
P_mat_form(distance_mat, c(1, 0.1), 10)

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