Description Usage Arguments Value See Also Examples
Carry out conditional simulation on a matrix of pixel-level value simulations to calculate overall or regional estimates of metrics, such total case numbers, prevalences or inequality metrics
1 |
vals |
a matrix of samples of pixel-level values where each row corresponds to a different pixels and each column to a different posterior sample |
weights |
an optional vector of weights in each cell, corresponding to
the rows of |
group |
an optional vector (of the same size as |
fun |
function to summarise the (weighted) elements of |
... |
other arguments to be passed to |
If group = NULL
, a vector of size equal to the number of
columns in vals
, each element giving a different simulated summary
across all pixels covered by vals
.
If group
is specified, a matrix of simulated summaries with each
row corresponding to a different unique value in group
(e.g. an
administrative unit) and each column corresponding to a different draw.
Other GIS: bufferMask
, getArea
,
getPoints
, insertRaster
,
ll2cart
, makeVoronoiPolygons
,
safeMask
, sortPolyData
1 2 3 4 5 6 7 8 9 10 11 12 13 | # make some fake prevalence map data
n_pixels <- 100
n_draws <- 10
prevalence <- matrix(runif(n_pixels * n_draws),
ncol = n_draws)
population <- rpois(n_pixels, 100)
# run overall simulation
draws <- condSim(prevalence, population)
# simulate by (made up) country to get the expected number of infections
country <- sample(letters[1:5], n_pixels, replace = TRUE)
draws <- condSim(prevalence, population, country)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.