sim: Simulate posterior observations

Description Usage Arguments Details Author(s) See Also

Description

Simulates posterior observations for map and map2stan model fits.

Usage

1
sim( fit , data , n=1000 , post , ll , refresh=0.1 , replace , ... )

Arguments

fit

Object of class map or map2stan

data

Optional list of data to compute predictions over

n

Number of samples to use

post

Samples from posterior. If missing, sim samples using n

...

Other parameters to pass to someone

Details

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.

Author(s)

Richard McElreath

See Also

link,map,map2stan


joepowers16/rethinking documentation built on June 2, 2019, 6:52 p.m.