sim | R Documentation |
Simulates posterior observations for map
and map2stan
model fits.
sim( fit , data , n=1000 , post , ll , refresh=0.1 , replace , ... )
fit |
Object of class |
data |
Optional list of data to compute predictions over |
n |
Number of samples to use |
post |
Samples from posterior. If missing, |
... |
Other parameters to pass to someone |
This function uses the model definition from a map
or map2stan
fit to simulate outcomes that average over the posterior distribution. It uses link
internally to process any linear models. Then the correspond random number function is used, as defined by the model's likelihood.
The rethinking
package defines a generic function sim
, so methods can be defined for other model fit classes. I might eventually build methods for lm
and glm
.
Richard McElreath
link
,map
,map2stan
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.