| kernel.function {KernGPLM} | R Documentation |
Calculates several kernel functions (uniform, triangle, epanechnikov, biweight, triweight, gaussian).
kernel.function(u, p = 2, q = 2, product = TRUE)
u |
n x d matrix |
p |
integer or text |
q |
integer |
product |
(if d>1) product or spherical kernel |
The parameters p>0 and q define the univariate kernel functions proportional to (1-|u|^p)^q. The multivariate kernels are obtained by a product of unvariate kernels K(u_1)...K(u_d) or by a spherical (radial symmetric) kernel proportional to K(||u||). (Proportional means that the resulting kernel is a density, i.e. integrates to 1.) If p=0 is set, the resulting kernel function is the gaussian (normal) kernel.
Alternatively, the p parameter may be a text string. Possible strings (and their related parameters) are "triangle" (p=q=1), "uniform" (p arbitrary, q=0), "epanechnikov" (p=2, q=1), "biweight" or "quartic" (p=q=2), "triweight" (p=2, q=3), "gaussian" or "normal" (p=0, q arbitrary).
n x 1 vector of kernel weights
Marlene Mueller
kernel.function(0) ## default (biweight) kernel.function(0,p=2,q=1) ## epanechnikov kernel.function(0,p=2,q=0) ## uniform