stochdom_bf: Bayes Factor for Stochastic Dominance of Continuous...

View source: R/stochdom_bf.R

stochdom_bfR 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 hist.

order

order constraint on the random variables across conditions. The default order="<" implies that the random variables increase across conditions (implying that the cdfs decrease: F_1(t) > F_2(t)).

...

further arguments passed to bf_multinom. Note that the noninformative default prior 1/number_of_bins is used.

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

multinomineq documentation built on Nov. 22, 2022, 5:09 p.m.