mSPRT: Calculate mixture Sequential Probability Ratio Test

Description Usage Arguments Value Details References

View source: R/mSPRT.R

Description

Calculate mixture Sequential Probability Ratio Test

Usage

1
2
mSPRT(x, y, xpre = NULL, ypre = NULL, sigma, tau, theta = 0,
  distribution = "normal", alpha = 0.05, useCpp = F)

Arguments

x, y

Numeric vectors

xpre, ypre

Numeric vectors of pre-experiment data

sigma

Population standard deviation

tau

Mixture variance

theta

Hypothesised difference between x and y

distribution

The desired distribution.

alpha

Significance level

useCpp

Boolean. Use C++ for calculations? Useful for running many tests as it reduces runtime substantially

Value

The likelihood ratio

Details

With normal data and normal prior, the closed form solution of the probability ratio after n observations have been collected is:

\tilde{Λ}_n = √{\frac{2σ^2}{V_n + nτ^2}}\exp{≤ft(\frac{n^2τ^2(\bar{Y}_n - \bar{X}_n-θ_0)^2}{4σ2(2σ^2+nτ^2)}\right)}.

With Bernoulli data, the closed form solution is:

\tilde{Λ}_n = √{\frac{V_n}{V_n + nτ^2}}\exp{≤ft(\frac{n^2τ^2(\bar{Y}_n - \bar{X}_n-θ_0)^2}{2V_n(V_n+nτ^2)}\right)}.

References

Johari, R., Koomen, P., Pekelis, L. & Walsh, D. 2017, 'Peeking at A/B Tests: Why it matters, and what to do about it', ACM, , pp. 1517


shitoushan/mixtureSPRT documentation built on Sept. 29, 2021, 7:46 a.m.