function R = testOS(B, data, pnorm, alpha) %Peforms the one-sample test. Set pnorm = inf for the %sup-norm statistic %INPUTS: % *B - number of Monte-Carlo samples to use to estimate the null distribution. % *data - r x d matrix. Each observation is dx1 vector and there are r % vectors % *pnorm - norm of the test (e.g. pnorm = inf) % *alpha - size of the test (e.g. alpha = .05) %OUTPUTS: % *R - indicator for rejection of the null hypothesis, mean vector equal to % zero %Step 1. Compute test stat T = norm_stat(data, pnorm); %Step 2. Estimate the Covariance Matrix sigma = covshrinkKPM(data, 1); %%Step 3. Approximate the null distribution nullv = null_distAC(B,sigma,pnorm); %Step 4. Decide to reject or not tail = 0; [CV R] = BSHTcv(T, nullv, alpha, tail);