Library: | kernel |
See also: | cosi gau qua tri trian uni |
Quantlet: | epa | |
Description: | computes the Epanechnikov (EPA) kernel, multivariate |
Usage: | y = epa(x) | |
Input: | ||
x | n x p x d1 x ... x dn array at which the kernel is to be computed | |
Output: | ||
y | n x 1 x d1 x ... x dn array containing the EPA kernel |
library("kernel") library("plot") x = aseq(-1, 41, 0.05) dat = x~epa(x) dat = setmask(dat, "line", "blue") d = createdisplay(1, 2) show(d, 1, 1, dat) x0 = #(-1, -1) h = #(0.1, 0.1) n = #(21, 21) x = grid(x0, h, n) ;; generates a bivariate grid f = epa(x) dat2 = grsurface(x~f) ;; generates surface show(d, 1, 2, dat2) ;; now rotate the surface setgopt(d, 1, 2, "title", "rotate!")
The Epanechnikov kernel is shown in 1 and 2 dimensions