Description Usage Arguments Details Value Examples
Estimates beta for an epidemic with a given R0 in a specific population in a spatial dataset, and calculates the expanded kernel matrix (expanded_D) to use when simulating an epidemic.
1 |
spatial_data |
The spatial_dataset containing the population data. |
dist_kernel |
The distance kernel matrix. |
contact_mat |
The contact matrix for mixing between age groups. |
R0 |
The desired value for R0. |
sigma |
The desired value for the recovery rate. |
This function is automatically executed when using the prep_simulation
function. It uses
the Next Generation Matrix approach to derive beta from R0.
Returns the value of beta and assigns the expanded_D matrix to the global environment.
1 2 3 4 5 6 7 8 9 10 | #Create a spatial dataset:
test_data = raster(nrow=10, ncol=10, xmn=1, xmx=100000, ymn=1, ymx=100000)
values(test_data) = runif(100, 1, 1000)
#Calculate distance kernel matrix and load age mixing matrix:
dist_mat = calc_dist_mat(test_data)
dist_kernel = calc_dist_kernel(dist_mat, dist_c = 87, test_data, alpha=0.95, p=6.6, p2=1.53, aa=35)
load_contact_mat()
beta = calc_beta(test_data, dist_kernel, contact_mat, R0=1.8, sigma=1/2.6)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.