bdm | R Documentation |
Calculates the Bayesian discrepancy measure for a precise null hypothesis.
bdm(posteriorDensityDraws, nullHypothesisValue=0)
posteriorDensityDraws |
Vector of (MCMC) posterior parameter draws. |
nullHypothesisValue |
Parameter value of the precise null hypothesis. Defaults to zero. |
The BDM is calculated as \delta_H(x):=2\cdot P(\theta \in I_H(x)|x)
where I_H(x):=(m,\theta_0)
if m<\theta_0
, I_H(x):=\{m\}
if m=\theta_0
and I_H(x):=(\theta_0,m)
if m>\theta_0
, where m
denotes the posterior median of the parameter \theta
, and the null hypothesis specifies H_0:\theta=\theta_0
.
Returns the value \delta_H(x)
of the BDM.
Riko Kelter
For details, see: https://arxiv.org/abs/2105.13716
set.seed(57)
grp1=rnorm(50,0,1.5)
grp2=rnorm(50,0.8,3.2)
p = as.vector(BayesFactor::ttestBF(x=grp1,y=grp2,
posterior = TRUE, iterations = 3000,
rscale = "medium")[,4])
bdm(p,0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.