Description Usage Arguments Details Value See Also Examples

View source: R/model_weights.R

Extract posterior samples of parameters averaged across models. Weighting can be done in various ways, for instance using Akaike weights based on information criteria or marginal likelihoods.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 |

`x` |
A |

`...` |
More |

`pars` |
Names of parameters for which to average across models. Only those parameters can be averaged that appear in every model. Defaults to all overlapping parameters. |

`weights` |
Name of the criterion to compute weights from. Should be one
of |

`nsamples` |
Total number of posterior samples to use. |

`missing` |
An optional numeric value or a named list of numeric values
to use if a model does not contain a parameter for which posterior samples
should be averaged. Defaults to |

`model_names` |
If |

`control` |
Optional |

`seed` |
A single numeric value passed to |

Weights are computed with the `model_weights`

method.

A `data.frame`

of posterior samples. Samples are rows
and parameters are columns.

1 2 3 4 5 6 7 8 9 10 11 12 13 | ```
## Not run:
# model with 'treat' as predictor
fit1 <- brm(rating ~ treat + period + carry, data = inhaler)
summary(fit1)
# model without 'treat' as predictor
fit2 <- brm(rating ~ period + carry, data = inhaler)
summary(fit2)
# compute model-averaged posteriors of overlapping parameters
posterior_average(fit1, fit2, weights = "waic")
## End(Not run)
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.