Uses link and sim for a list of map or map2stan model fits to construct Akaike weighted ensemble of predictions.
ensemble( ... , data , n=1e3 , func=WAIC , weights , WAIC=TRUE , refresh=0 ,
replace=list() , do_link=TRUE , do_sim=TRUE )map or map2stan models
Optional data to compute predictions over, as in link and sim
Number of samples to draw from posterior for each model
Function to use in computing criterion for model weights
Optional vector of weights to use. If present, func is ignored.
Deprecated: If TRUE, use func to compute weights. Otherwise tries to use DIC.
Progress update refresh interval. 0 suppresses output.
Optional named list with replacement posterior samples. Used for maginalizing over random effects, for example. See example in link.
If TRUE, compute and return link results
If TRUE, compute and return sim results
This function calls link and sim for each fit model given as input. The results are then combined into ensemble link and simulation output, where samples from each model are represented in proportion to the Akaike weights. Akaike weights are calculated by compare, using func, unless an explicit vector weights is provided. The values in weights will be normalized to sum to one, if they do not already.
Note that no averaging is done by this function. Parameters are not averaged, and predictions are not averaged.