Library: | smoother |
See also: | binlindata Rdenbest denbbwcrit |
Quantlet: | binweights | |
Description: | direct computation of the autocovariances of the bincounts needed for fast computation of the kernel estimates of the integrated squared density derivatives. |
Usage: | binw = binweights(binc) | |
Input: | ||
binc | m x 1 vector, corresponding to the bin counts as output from binlindata or a similar procedure | |
Output: | ||
binw | m x 1 vector, autocovariances of bin counts |
library("smoother") library("xplore") n = 1000 d = 0.1 {w,mu,sigma}=normalmixselect("Marron_Wand_8") x = normalmix(n,w,mu,sigma) ; x = round(x,1) {bing,binc}=binlindata(x,d) binw = binweights(binc) bing~binc~binw n~sum(binc) (binw[1]+2*sum(binw[2:rows(binw)])) /(n*n)
Generates 1000 variates from a normal mixture example density, optionally rounds them, computes a bin grid, the corresponding bincounts and the bin weights. The bin counts sum up to the total sample size and, as a check, the last expression should be 1.