convol {KernGPLM}R Documentation

Kernel convolution

Description

Calculates the convolution of data with a kernel function.

Usage

convol(x, h = 1, grid = NULL, y = 1, w = 1, p = 2, q = 2,
       product = TRUE, sort = TRUE)

Arguments

x n x d matrix, data
h scalar or 1 x d, bandwidth(s)
grid m x d matrix, where to calculate the convolution (default = x)
y n x c matrix, optional responses
w scalar or n x 1 or 1 x m or n x m, optional weights
p integer or text, see kernel.function
q integer, see kernel.function
product (if d>1) product or spherical kernel
sort sort the data, necessary to use the DLL code

Details

The kernel convolution which is calculated is sum_i K_h(x_i - grid_{j}),y_i,w_{ij} for i=1,...,n and j=1,...,m.

Value

m x c matrix

Author(s)

Marlene Mueller

See Also

kernel.function, kde, kreg

Examples

  n <- 100
  x <- rnorm(n)
  convol(x,h=0.8,grid=-3:3)/n  ## estimates density of x at points -3:3

[Package KernGPLM version 0.65 Index]