Learn R Programming

dslice (version 1.2.2)

ds_eqp_1: Non-parametric one-sample hypothesis testing via dynamic slicing

Description

Non-parametric one-sample hypothesis testing via dynamic slicing with \(O(n)\)-resolution. The basic idea of ds_eqp_1 is almost the same as ds_1. Difference between these two functions is that ds_eqp_1 considers an equal partition on [0, 1] but ds_1 does not. Candidate slicing boundaries in ds_eqp_1 only depend on the total number of samples and are unrelated to sample quantiles. In ds_1 they are immediately to the left or right of sample quantile.

Usage

ds_eqp_1(y, lambda)

Value

Value of dynamic slicing statistic for one-sample test. It is nonnegative. The null hypothesis that observations are from the null distribution is rejected if this statistic is greater than zero, otherwise accept the null hypothesis.

Arguments

y

Vector: quantiles of observations according to null distribution.

lambda

lambda penalizes the number of slices to avoid too many slices. Since the interval [0, 1] is divided into \(n\) equal size element-slice and slicing strategy only consider boundaries of them, this version of dynamic slicing does not require penlaty lambda as ds_1. lambda should be greater than 0.

See Also

ds_1.

Examples

Run this code
n <- 100
mu <- 0.5
x <- rnorm(n, mu, 1)
y <- pnorm(sort(x), 0, 1) 
lambda <- 1.0
dsres <- ds_eqp_1(y, lambda)

Run the code above in your browser using DataLab