| convol {KernGPLM} | R Documentation |
Calculates the convolution of data with a kernel function.
convol(x, h = 1, grid = NULL, y = 1, w = 1, p = 2, q = 2,
product = TRUE, sort = TRUE)
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 |
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.
m x c matrix
Marlene Mueller
n <- 100 x <- rnorm(n) convol(x,h=0.8,grid=-3:3)/n ## estimates density of x at points -3:3