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

error_measures

Error Measures for Estimated Marginal Likelihood


Description

Computes error measures for estimated marginal likelihood.

Usage

error_measures(bridge_object, ...)

## S3 method for class 'bridge'
error_measures(bridge_object, ...)

## S3 method for class 'bridge_list'
error_measures(bridge_object, na.rm = TRUE, ...)

Arguments

bridge_object

an object of class "bridge" or "bridge_list" as returned from bridge_sampler.

...

additional arguments (currently ignored).

na.rm

a logical indicating whether missing values in logml estimates should be removed. Ignored for the bridge method.

Details

Computes error measures for marginal likelihood bridge sampling estimates. The approximate errors for a bridge_object of class "bridge" that has been obtained with method = "normal" and repetitions = 1 are based on Fruehwirth-Schnatter (2004). Not applicable in case the object of class "bridge" has been obtained with method = "warp3" and repetitions = 1. To assess the uncertainty of the estimate in this case, it is recommended to run the "warp3" procedure multiple times.

Value

If bridge_object is of class "bridge" and has been obtained with method = "normal" and repetitions = 1, returns a list with components:

  • re2: approximate relative mean-squared error for marginal likelihood estimate.

  • cv: approximate coefficient of variation for marginal likelihood estimate (assumes that bridge estimate is unbiased).

  • percentage: approximate percentage error of marginal likelihood estimate.

If bridge_object is of class "bridge_list", returns a list with components:

  • min: minimum of the log marginal likelihood estimates.

  • max: maximum of the log marginal likelihood estimates.

  • IQR: interquartile range of the log marginal likelihood estimates.

Note

For examples, see bridge_sampler and the accompanying vignettes:
vignette("bridgesampling_example_jags")
vignette("bridgesampling_example_stan")

Author(s)

Quentin F. Gronau

References

Fruehwirth-Schnatter, S. (2004). Estimating marginal likelihoods for mixture and Markov switching models using bridge sampling techniques. The Econometrics Journal, 7, 143-167. doi: 10.1111/j.1368-423X.2004.00125.x

See Also

The summary methods for bridge and bridge_list objects automatically invoke this function, see bridge-methods.


bridgesampling

Bridge Sampling for Marginal Likelihoods and Bayes Factors

v1.1-2
GPL (>= 2)
Authors
Quentin F. Gronau [aut, cre] (<https://orcid.org/0000-0001-5510-6943>), Henrik Singmann [aut] (<https://orcid.org/0000-0002-4842-3657>), Jonathan J. Forster [ctb], Eric-Jan Wagenmakers [ths], The JASP Team [ctb], Jiqiang Guo [ctb], Jonah Gabry [ctb], Ben Goodrich [ctb], Kees Mulder [ctb], Perry de Valpine [ctb]
Initial release

We don't support your browser anymore

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