stochdom_bf {multinomineq} | R Documentation |
Bayes Factor for Stochastic Dominance of Continuous Distributions
Description
Uses discrete bins (as in a histogram) to compute the Bayes factor in favor of stochastic dominance of continuous distributions.
Usage
stochdom_bf(x1, x2, breaks = "Sturges", order = "<", ...)
Arguments
x1 |
a vector with samples from the first random variable/experimental condition. |
x2 |
a vector with samples from the second random variable/experimental condition. |
breaks |
number of bins of histogram. See |
order |
order constraint on the random variables across conditions.
The default |
... |
further arguments passed to |
References
Heathcote, A., Brown, S., Wagenmakers, E. J., & Eidels, A. (2010). Distribution-free tests of stochastic dominance for small samples. Journal of Mathematical Psychology, 54(5), 454-463. doi:10.1016/j.jmp.2010.06.005
Examples
x1 <- rnorm(300, 0, 1)
x2 <- rnorm(300, .5, 1) # dominates x1
x3 <- rnorm(300, 0, 1.2) # intersects x1
plot(ecdf(x1))
lines(ecdf(x2), col = "red")
lines(ecdf(x3), col = "blue")
b12 <- stochdom_bf(x1, x2, order = "<", M = 5e4)
b13 <- stochdom_bf(x1, x3, order = "<", M = 5e4)
b12$bf
b13$bf