Learn R Programming

emplikAUC (version 0.5)

smooth3vec: Smoothed indicator function I[x < const], which is the integration of the Epanechnikov kernal.

Description

This function computes the smoothed Indicator function I[x < const] using a 3rd order polynomial.

If |x - const| > eps then the result is the same as the indicator function I[x < const] (either 0 or 1). For |x - const| < eps, it is a 3rd order polynomial.

\(eps\) is a scalar, must > 0. It is the smoothing window width.

Usage

smooth3vec(x, const, eps=0.05)

Value

smooth3vec returns a vector of length=length(x). The entry of the vector are smoothed values of I[x[i] < const].

Arguments

x

a vector of observations, length m, for the first sample.

const

a single number.

eps

The smoothing window width, must be >0. Ideally this should be sample size dependent.

Author

Mai Zhou <maizhou@gmail.com>.

Details

This function is similar to smooth3 but only compare the x vector to a single number and thus returns a vector instead of matrix. You may also use the smooth3() with a bit care, for that matter, but this vector version should be faster and save memory. It is listed here because the user may find it useful elsewhere.

We used this function to estimate the quantile from the x-sample.

References

Zhao, Y., Ding, X. and Zhou (2021). Confidence Intervals of AUC and pAUC by Empirical Likelihood. Tech Report. https://www.ms.uky.edu/~mai/research/eAUC1.pdf

Examples

Run this code
y <- c(10, 209, 273, 279, 324, 391, 566, 785)
x <- c(21, 38, 39, 51, 77, 185, 240, 289, 524)

Run the code above in your browser using DataLab