Learn R Programming

locpol (version 0.8.0)

compKernVals: Compute kernel values.

Description

Some R code provided to compute kernel related values.

Usage

computeRK(kernel, lower=dom(kernel)[[1]], upper=dom(kernel)[[2]],
			subdivisions = 25)
	computeK4(kernel, lower=dom(kernel)[[1]], upper=dom(kernel)[[2]],
			subdivisions = 25)
	computeMu(i, kernel, lower=dom(kernel)[[1]], upper=dom(kernel)[[2]],
			subdivisions = 25)
	computeMu0(kernel, lower=dom(kernel)[[1]], upper=dom(kernel)[[2]],
			subdivisions = 25)
	Kconvol(kernel,lower=dom(kernel)[[1]],upper=dom(kernel)[[2]],
			subdivisions = 25)

Value

A numeric value returning:

computeK4

The fourth order autoconvolution of K.

computeRK

The second order autoconvolution of K.

computeMu0

The integral of K.

computeMu2

The second order moment of K.

computeMu

The \(i\)-th order moment of K.

Kconvol

The autoconvolution of K.

These functions are implemented by means of integrate.

Arguments

kernel

Kernel used to perform the estimation, see Kernels

i

Order of kernel moment to compute

lower, upper

Integration limits.

subdivisions

the maximum number of subintervals.

Author

Jorge Luis Ojeda Cabrera.

Details

These functions uses function integrate.

References

Fan, J. and Gijbels, I. Local polynomial modelling and its applications\/. Chapman & Hall, London (1996).

Wand, M.~P. and Jones, M.~C. Kernel smoothing\/. Chapman and Hall Ltd., London (1995).

See Also

RK, Kernel characteristics, integrate.

Examples

Run this code
	##	Note that lower and upper params are set in the definition to
	##	use 'dom()' function.
	g <- function(kernels)
	{
		mu0 <- sapply(kernels,function(x) computeMu0(x,))
		mu0.ok <- sapply(kernels,mu0K)
		mu2 <- sapply(kernels,function(x) computeMu(2,x))
		mu2.ok <- sapply(kernels,mu2K)
		Rk.ok <- sapply(kernels,RK)
		RK <- sapply(kernels,function(x) computeRK(x))
		K4 <- sapply(kernels,function(x) computeK4(x))
		res <- data.frame(mu0,mu0.ok,mu2,mu2.ok,RK,Rk.ok,K4)
		res
	}
	g(kernels=c(EpaK,gaussK,TriweigK,TrianK))

Run the code above in your browser using DataLab