Library: | kernel |
See also: |
Quantlet: | symweigh | |
Description: | computes the symmetrical weights for a selected kernel |
Usage: | y = symweigh (x, h, n, f) | |
Input: | ||
x | m x 1 vector, n-dimensional origin point | |
h | m x 1 vector or scalar, h[i] contains bandwidth on i-th dimension; if scalar, same bandwidth in all m dimensions | |
n | m x 1 vector or scalar, n[i] contains number of steps on i-th dimension; if scalar, same number of steps in all m dimensions | |
f | string, name of the function computing the selected kernel | |
Output: | ||
y | k x 1 matrix, weights for selected kernel |
library("kernel") x=(0.1)*(1:4) h=x n=10*x+1 y = symweigh(x, h, n, "qua") y
Symmetrical weights for selected kernel: Contents of y [ 1,] 0.0080048 [ 2,] 0.007527 [ 3,] 0.0061287 [ 4,] 0.0057629 [ 5,] 0.0035577 [ 6,] 0.0033454 [ 7,] 0.0039594 [ 8,] 0.0037231 [ 9,] 0.0030314 [ 10,] 0.0028505 ... [119,] 0 [120,] 0
library("kernel") x=(0.1)*(1:4) h=0.1 n=3 y = symweigh(x, h, n, "qua") y
Symmetrical weights for selected kernel: [ 1,] 0.0013994 [ 2,] 0.0013159 [ 3,] 0.0011824 [ 4,] 0.0012575 [ 5,] 0.0011824 [ 6,] 0.0010624 [ 7,] 0.0010714 [ 8,] 0.0010075 [ 9,] 0.00090527 [10,] 0.0011924 ... [80,] 0.00039727 [81,] 0.00035696