Description Usage Arguments Details Value See Also Examples

View source: R/model_weights.R

Compute posterior predictive draws 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 15 16 17 |

`x` |
A |

`...` |
More |

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

`method` |
Method used to obtain predictions to average over. Should be
one of |

`ndraws` |
Total number of posterior draws to use. |

`nsamples` |
Deprecated alias of |

`summary` |
Should summary statistics
(i.e. means, sds, and 95% intervals) be returned
instead of the raw values? Default is |

`probs` |
The percentiles to be computed by the |

`robust` |
If |

`model_names` |
If |

`control` |
Optional |

`seed` |
A single numeric value passed to |

Weights are computed with the `model_weights`

method.

Same as the output of the method specified
in argument `method`

.

`model_weights`

, `posterior_average`

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | ```
## 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 predicted values
(df <- unique(inhaler[, c("treat", "period", "carry")]))
pp_average(fit1, fit2, newdata = df)
# compute model-averaged fitted values
pp_average(fit1, fit2, method = "fitted", newdata = df)
## 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.