dkern {npmlreg} | R Documentation |
Discrete kernel for categorical data with k
unordered categories.
dkern(x, y, k, lambda)
x |
categorical data vector |
y |
postive integer defining a fixed category |
k |
positive integer giving the number of categories |
lambda |
smoothing parameter |
This kernel was introduced in Aitchison & Aitken (1976); see also Titterington (1980).
The setting lambda =1/k
corresponds to the extreme case 'maximal smoothing',
while lambda = 1
means `no smoothing'. Statistically sensible settings are
only 1/k
<= lambda
<=1
.
Jochen Einbeck (2006)
Aitchison, J. and Aitken, C.G.G. (1976). Multivariate binary discrimination by kernel method. Biometrika 63, 413-420.
Titterington, D. M. (1980). A comparative study of kernel-based density estimates for categorical data. Technometrics, 22, 259-268.
k<-6; dkern(1:k,4,k,0.99) # Kernel centered at the 4th component with a very small amount of smoothing. ## The function is currently defined as function(x,y,k,lambda){ ifelse(y==x, lambda, (1-lambda)/(k-1)) }