mult_bf_equality {multibridge} | R Documentation |
Computes Bayes Factors For Equality Constrained Multinomial Parameters
Description
Computes Bayes factor for equality constrained multinomial parameters
using the standard Bayesian multinomial test.
Null hypothesis H_0
states that category proportions are exactly equal to those
specified in p
.
Alternative hypothesis H_e
states that category proportions are free to vary.
Usage
mult_bf_equality(x, a, p = rep(1/length(a), length(a)))
Arguments
x |
numeric. Vector with data |
a |
numeric. Vector with concentration parameters of Dirichlet distribution. Must be the same length as |
p |
numeric. A vector of probabilities of the same length as |
Details
The model assumes that data follow a multinomial distribution and assigns a Dirichlet distribution as prior for the model parameters (i.e., underlying category proportions). That is:
x ~ Multinomial(N, \theta)
\theta ~ Dirichlet(\alpha)
Value
Returns a data.frame
containing the Bayes factors LogBFe0
, BFe0
, and BF0e
Note
The following signs can be used to encode restricted hypotheses: "<"
and ">"
for inequality constraints, "="
for equality constraints,
","
for free parameters, and "&"
for independent hypotheses. The restricted hypothesis can either be a string or a character vector.
For instance, the hypothesis c("theta1 < theta2, theta3")
means
-
theta1
is smaller than boththeta2
andtheta3
The parameters
theta2
andtheta3
both havetheta1
as lower bound, but are not influenced by each other.
The hypothesis c("theta1 < theta2 = theta3 & theta4 > theta5")
means that
Two independent hypotheses are stipulated:
"theta1 < theta2 = theta3"
and"theta4 > theta5"
The restrictions on the parameters
theta1
,theta2
, andtheta3
do not influence the restrictions on the parameterstheta4
andtheta5
.-
theta1
is smaller thantheta2
andtheta3
-
theta2
andtheta3
are assumed to be equal -
theta4
is larger thantheta5
References
Damien P, Walker SG (2001). “Sampling truncated normal, beta, and gamma densities.” Journal of Computational and Graphical Statistics, 10, 206–215.
Gronau QF, Sarafoglou A, Matzke D, Ly A, Boehm U, Marsman M, Leslie DS, Forster JJ, Wagenmakers E, Steingroever H (2017). “A tutorial on bridge sampling.” Journal of Mathematical Psychology, 81, 80–97.
Frühwirth-Schnatter S (2004). “Estimating marginal likelihoods for mixture and Markov switching models using bridge sampling techniques.” The Econometrics Journal, 7, 143–167.
Sarafoglou A, Haaf JM, Ly A, Gronau QF, Wagenmakers EJ, Marsman M (2021). “Evaluating Multinomial Order Restrictions with Bridge Sampling.” Psychological Methods.
See Also
Other functions to evaluate informed hypotheses:
binom_bf_equality()
,
binom_bf_inequality()
,
binom_bf_informed()
,
mult_bf_inequality()
,
mult_bf_informed()
Examples
data(lifestresses)
x <- lifestresses$stress.freq
a <- rep(1, nrow(lifestresses))
mult_bf_equality(x=x, a=a)