savage.dickey.bf: Savage-Dickey density ratio

Description Usage Arguments Value

View source: R/savage_dickey_bf.R

Description

Approximate the Savage-Dickey density ratio, and compute Bayes factor in favour of null hypothesis. As input it takes a vector of samples, which should represent the posterior distribution of the quantity of interests, usually obtained through MCMC sampling. The function assumes a Gaussian prior (the default is mean 0 and sd 1).

Usage

1
2
savage.dickey.bf(x, x_0 = 0, prior.mean = 0, prior.sd = 1,
  plot = F)

Arguments

x

vector of samples from posterior distribution

x_0

location of point-null hypothesis (usally zero)

prior.mean

mean of Gaussian prior used to estiamte the model

prior.sd

standard deviation of Gaussian prior used to estiamte the model

plot

logical: should the prior and posterior probability be plotted?

Value

Bayes factor, indicating how likely are the data under the null hypothesis, compared to the alternative.


mattelisi/mlisi documentation built on Oct. 13, 2019, 5:59 p.m.