kernel.function {KernGPLM}R Documentation

Kernel function

Description

Calculates several kernel functions (uniform, triangle, epanechnikov, biweight, triweight, gaussian).

Usage

kernel.function(u, p = 2, q = 2, product = TRUE)

Arguments

u n x d matrix
p integer or text
q integer
product (if d>1) product or spherical kernel

Details

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).

Value

n x 1 vector of kernel weights

Author(s)

Marlene Mueller

Examples

  kernel.function(0)          ## default (biweight)
  kernel.function(0,p=2,q=1)  ## epanechnikov
  kernel.function(0,p=2,q=0)  ## uniform

[Package KernGPLM version 0.65 Index]