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

summaryDiff

Posterior summary statistics for a difference of two quantities


Description

It calculates (posterior) summary statistics for a difference of two quantities supplied as (MCMC) samples Within mixAK package it is primarily used to calculate posterior summary for the difference of the deviances of two competing models.

Usage

summaryDiff(x, y, prob=c(0.025, 0.5, 0.975), cut=c(-2*log(9), 0), na.rm=TRUE)

Arguments

x

a numeric vector with the sample of the first quantity.

y

a numeric vector with the sample of the second quantity to be subtracted from x.

prob

a numeric vector of probabilities for quantiles to be calculated from the sample of differences.

cut

numeric value(s) which specify the cutoff(s) we are interested in estimating P(x - y < cut) from the sample. The default values are motivated by the arguments given in Section 4 of Aitkin, Liu and Chadwick (2009) and in Section 7.5 of Aitkin (2010).

na.rm

logical indicating on how to handle NA's.

Value

A list with the components

summary

a named vector with the (posterior) summary statistics based on the differences.

Pcut

estimated (posterior) probabilities that the difference lies below the cut values.

Author(s)

References

Aitkin, M. (2010). Statistical Inference: An Integrated Bayesian/Likelihood Approach. Boca Raton: CRC Press.

Aitkin, M., Liu, C. C., and Chadwick, T. (2009). Bayesian model comparison and model averaging for small-area estimation. Annals of Applied Statistics, 3, 199-221.

Examples

set.seed(16336886)
x <- runif(100, 0, 100)
y <- runif(100, 0, 100)
sdiff <- summaryDiff(x, y)

mixAK

Multivariate Normal Mixture Models and Mixtures of Generalized Linear Mixed Models Including Model Based Clustering

v5.3
GPL (>= 3)
Authors
Arnošt Komárek <arnost.komarek@mff.cuni.cz>
Initial release
2020-06-02

We don't support your browser anymore

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