Description Usage Arguments Details Value Examples
Adjusts beta to fit the incidence of one resolution onto another.
1 2 |
fit_data |
The incidence data to use for fitting. |
spatial_data |
The spatial dataset to be fitted. |
interval |
The interval on which the fit should be performed, in days (default is c(1,100) - i.e. the fit will be performed on the first 100 days of the epidemic). |
stoch |
Logical. If TRUE (default), fitting will be performed using the median of x stochastic runs. If FALSE, fitting will be performed using the deterministic output. |
num_runs |
Number of stochastic runs to extract the median incidence for one beta value (default is 100). Higher values will be longer to run, but yield more accurate results. (only considered if stoch = TRUE) |
search_range |
Search range for the fitted value of beta (default is c(0.02,0.05)). |
The fitting is performed by assuming the fitted incidence belongs to a Poisson distribution with the expected values being the values from fit_data. Consequently, the values from fit_data must be integers.
Returns the fitted value of beta.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #Create a high resolution spatial dataset:
htest_data = raster(nrow=20, ncol=20, xmn=1, xmx=100000, ymn=1, ymx=100000)
values(htest_data) = runif(400, 1, 1000)
#Calculate the median incidence for the high resolution data:
prep_simulation(htest_data)
results_high = run_multi_stoch(100, htest_data, expanded_D, contact_mat, beta, t_max=100)
results_high = round(results_high$Median)
#Create a low resolution spatial dataset (4 times less areas than htest_data):
ltest_data = aggregate(htest_data, fact=2, fun=sum)
#Fit low resolution on high resolution:
fitted_beta = fit_beta(results_high, ltest_data, interval=c(1,100))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.