Generate a random sample from a model's predictive distribution given a set of parameters
Source:R/data-gen.R
model_sim.RdGenerates samples from the predictive distribution of a model given a set of parameters. This is primarily used for prior predictive checks and simulation studies.
Arguments
- dat
A
listcontaining the data and prior parameters, typically generated bymake_data()ormake_data_sdm().- model
A
characterstring specifying the model type. Must be either "drm" or "sdm". Defaults to "drm".- selectivity
a numeric
vectorwith the same length as the number of age-groups.- pars
a named
listof model parameters.- ...
parameters passed on to
pop_dyn.
Details
See this link for the rlang::.data import.