msBP.test: Multiscale testing of group differences

View source: R/msBP.test.R

msBP.testR Documentation

Multiscale testing of group differences

Description

Performs multiscale hypothesis testing of difference in the distribution of two groups using msBP prior.

Usage

msBP.test(y, a, b, group, priorH0 = 0.5,
		mcmc, maxScale = 5, plot.it = FALSE, ...)

Arguments

y

The pooled sample of observations

a,b

Parameters of the msBP prior

group

Vector of size length(y) with 0 and 1 denoting the group membership.

priorH0

Prior gues for the probability of H0

mcmc

a list giving the MCMC parameters. It must include the following integers: nb giving the number of burn-in iterations, nrep giving the total number of iterations (including nb)., and ndisplay giving the multiple of iterations to be displayed on screen while the MCMC is running (a message will be printed every ndisplay iterations).

maxScale

maximum scale of the binary trees.

plot.it

logical. If TRUE a plot of the posterior mean probability of H0 is produced

...

additional arguments to be passed.

Value

a list containing

Ps

a matrix with maxScale rows and mcmc$nrep columns with the MCMC draws of posterior probabilities of H0 for each scale

Ps

the posterior mean probabilities of H0 for each scale.

References

Canale, A. and Dunson, D. B. (2016), "Multiscale Bernstein polynomials for densities", Statistica Sinica, 26(3), 1175-1195.

Canale, A. (2017), "msBP: An R Package to Perform Bayesian Nonparametric Inference Using Multiscale Bernstein Polynomials Mixtures". Journal of Statistical Software, 78(6), 1-19.

Examples

set.seed(1)
y <- runif(100)
g <- c(rep(0,50), rep(1,50))
mcmc <- list(nrep = 5000, nb = 1000, ndisplay = 500)
## Not run: 
test.res <- msBP.test(y, 5, 1, g, mcmc=mcmc, plot.it = TRUE)

## End(Not run)

msBP documentation built on Aug. 23, 2023, 1:06 a.m.