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

Description Usage Arguments Value

View source: R/unupdate.R

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

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
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.


DominiqueMakowski/bayestestR documentation built on Sept. 24, 2021, 7:21 p.m.