Draw a sample from a population model.
# S3 method for edp_population_model
simulate(object, nsim = 1, seed = NULL, ...,
target = NULL, columns = NULL, given = NULL, by_model = FALSE)
an EDP population model, from popmod(...)
number of rows to simulate
if set, an integer to pass to EDP as a random seed for this call
ignored, accepted for compatibility with simulate
a character vector of column names, defaults to
names(pm)
alias for target
for compatibility with simulate
a single-row data frame of values to condition on;
data.frame(a = 3)
means to simulate from the conditional
distribution given a
is 3.
If false (the default), draws a sample of size nsim
.
If true, draws a sample of size nsim
from each sub-model in the
underlying model ensemble.
A data frame with the columns specified in target
. If by_model
is true, the result contains an additional column, "model," specifying which
sub-model that row came from.