SAMC: Stochastic Approximation Monte Carlo (SAMC)

Description Usage Arguments Examples

View source: R/SAMCfunctions.R

Description

This function implements the SAMC algorithm developed by Liang et al. (2007) and tailored to p-value estimation by Yu et al. (2011)

Usage

1
SAMC(x, y, testStat = ratioMean, B = 1e+05, m = 300, b0 = 1000)

Arguments

x

First sample

y

Second sample

testStat

Test statistic, defaults to the ratio of the means (ratioMean). Other choices are diffMean, ratioMedian, and diffMedian.

B

Total Number of Monte Carlo iterations. Defaults to 10e4.

m

Total number of regions in the SAMC algorithm. Note: SAMC regions are different than fastPerm partitions.

b0

Iteration at which the updates begin to decay.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
x <- rexp(100, 5)
y <- rexp(100, 2)
sam <- SAMC(x, y)
sam

x <- rnorm(110, 0, 1)
y <- rnorm(110, 1, 1)
sam <- SAMC(x, y, testStat = diffMean)
sam
plot(sam)

bdsegal/fastPerm documentation built on July 22, 2019, 1:25 p.m.