Learn R Programming

DiagTest3Grp (version 1.6)

KernelSmoothing.cdf: Kernel smoothing cumulative density function (CDF)

Description

Calculate the kernel smoothing cumulative density function (CDF) of a given sample data at a user-specified value.

Usage

KernelSmoothing.cdf(xx, c0, bw)

Arguments

xx
A numeric vector, sample data.
c0
A numeric value, the cumulative probability for which $P(xx
bw
A numeric value indicating the bandwidth used in the kernel smoothing density approximation.

Value

Return a numeric value---the cumulative probability.

Details

Kernel smoothing is a popular method to approximate a probability density function (PDF) or cumulative density function (CDF). Normal density function is conveniently used in the function as the kernel density and bandwidth is calculated according to the normal reference rule or the Sheather-Jones plug-in method in the package or can be specified arbitrarily by users. For a sample data xx,the cumulative CDF $P(xx

References

Silverman, B.W. (1986) Density Estimation for Statistics and Data Analysis. Chapman & Hall. Wasserman, L. (2005) All of Statistics: A Concise Course in Statistical Inference. Springer

See Also

BW.ref Youden3Grp

Examples

Run this code

###generate data
x <- rnorm(100,10,1.5)

##calcualte bandwidth by normal refernce rule 
bw1 <- KernelSmoothing.cdf(xx=x, c0=6, bw=0.1)

Run the code above in your browser using DataLab