Keywords - Function groups - @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Library: kernel
See also: rkernpq repa rqua rtrian runi tri

Quantlet: rtri
Description: computes the radial symmetric triweight kernel

Usage: y = rtri (x)
Input:
x n x d matrix of user-defined data for which the kernel is to be computed
Output:
y n x 1 matrix containing the radial triweight kernel

Example:
library("kernel")	; load library kernel
d  = 3			; choose dimension
n  = 1000		; choose n points uniformly in [-1,1]^d
x  = 2*uniform(n,d)-1
y  = rtri(x)		; compute kernel values
; approximate the integral about the kernel
; function in [-1,1]^d
sum(y.*2^d/n)

Result:
Independent of d you should get approximately 1 as result.
Note that for higher dimensions n has to be increased!
Example:
library("kernel")	; load kernel library
library("plot")		; load plot library
d  = 2			; choose dimension
o  = matrix(d)		; create uniform grid in [-1,1]^d
n  = 50.*o
h  = 2/(n-1).*o
x0 = -o
x  = grid(x0, h, n)
y  = rtri(x) 		; compute kernel values
plot(x~y)		; show kernel function(d<3)

Result:
Shows the radial triweight kernel. Note that d can only
take the values d=1 or d=2 to show something useful!



Author: S. Klinke, 20011031
(C) MD*TECH Method and Data Technologies, 05.02.2006