posterior_odds: Get the posterior odds and posterior p-value

Description Usage Arguments Examples

View source: R/functions.R

Description

Evaluates the density at the null hypothesis vs the density at the estimate, and calculates the posterior odds as P(H0 | Data) / P(theta_hat | Data). Taking inspiration from Mills' (2014, 2017) Bayesian Hypothesis Testing approach, the posterior odds are also converted to a probability. The probability is calculated as odds / 1+odds. This provides a p-value type measure without the need to calculate Bayes Factors for conversion to posterior error probabilities. This can be extremely useful when prior samples are not available. Note that Savage-Dickey Density Ratio Bayes Factors evaluate P(H0 | Data) / P(H0) and characterize the change in probability between the null hypothesis in the prior and posterior. Mill's Posterior Odds characterizes the relative posterior probability in the null hypothesis to the point estimate. Hence, the two approaches to calculating odds and p-values differ in what question is answered.

Usage

1
posterior_odds(posterior, H0, method = "mean")

Arguments

posterior

a vector or data frame of posterior samples

H0

a single value or a vector of values for the null hypothesis

method

whether the mean (default) or median should be used for the hypothesis test

Examples

1

abnormally-distributed/abdisttools documentation built on May 5, 2019, 7:07 a.m.