Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

unupdate

Un-update Bayesian models to their prior-to-data state


Description

As posteriors are priors that have been updated after observing some data, the goal of this function is to un-update the posteriors to obtain models representing the priors. These models can then be used to examine the prior predictive distribution, or to compare priors with posteriors.

This function in used internally to compute Bayes factors.

Usage

unupdate(model, verbose = TRUE, ...)

## S3 method for class 'stanreg'
unupdate(model, verbose = TRUE, ...)

## S3 method for class 'brmsfit'
unupdate(model, verbose = TRUE, ...)

## S3 method for class 'brmsfit_multiple'
unupdate(model, verbose = TRUE, newdata = NULL, ...)

## S3 method for class 'blavaan'
unupdate(model, verbose = TRUE, ...)

Arguments

model

A fitted Bayesian model.

verbose

Toggle warnings.

...

Not used

newdata

List of data.frames to update the model with new data. Required even if the original data should be used.

Value

A model un-fitted to the data, representing the prior model.


bayestestR

Understand and Describe Bayesian Models and Posterior Distributions

v0.10.0
GPL-3
Authors
Dominique Makowski [aut, cre] (<https://orcid.org/0000-0001-5375-9967>, @Dom_Makowski), Daniel Lüdecke [aut] (<https://orcid.org/0000-0002-8895-3206>, @strengejacke), Mattan S. Ben-Shachar [aut] (<https://orcid.org/0000-0002-4287-4801>, @mattansb), Indrajeet Patil [aut] (<https://orcid.org/0000-0003-1995-6531>, @patilindrajeets), Michael D. Wilson [aut] (<https://orcid.org/0000-0003-4143-7308>), Paul-Christian Bürkner [rev], Tristan Mahr [rev] (<https://orcid.org/0000-0002-8890-5116>), Henrik Singmann [ctb] (<https://orcid.org/0000-0002-4842-3657>), Quentin F. Gronau [ctb] (<https://orcid.org/0000-0001-5510-6943>), Sam Crawley [ctb] (<https://orcid.org/0000-0002-7847-0411>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.