Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

binning

Linear binning for multivariate data


Description

Linear binning for 1- to 4-dimensional data.

Usage

binning(x, H, h, bgridsize, xmin, xmax, supp=3.7, w, gridtype="linear")

Arguments

x

matrix of data values

H,h

bandwidth matrix, scalar bandwidth

xmin,xmax

vector of minimum/maximum values for grid

supp

effective support for standard normal is [-supp,supp]

bgridsize

vector of binning grid sizes

w

vector of weights. Default is a vector of all ones.

gridtype

not yet implemented

Details

For ks >= 1.10.0, binning is available for unconstrained (non-diagonal) bandwidth matrices. Code is used courtesy of A. & J. Gramacki, and M.P. Wand. Default bgridsize are d=1: 401; d=2: rep(151, 2); d=3: rep(51, 3); d=4: rep(21, 4).

Value

Returns a list with 2 fields

counts

linear binning counts

eval.points

vector (d=1) or list (d>=2) of grid points in each dimension

References

Gramacki, A. & Gramacki, J. (2016) FFT-based fast computation of multivariate kernel estimators with unconstrained bandwidth matrices. Journal of Computational & Graphical Statistics, 26, 459-462.

Wand, M.P. & Jones, M.C. (1995) Kernel Smoothing. Chapman & Hall. London.

Examples

data(unicef)
ubinned <- binning(x=unicef)

ks

Kernel Smoothing

v1.12.0
GPL-2 | GPL-3
Authors
Tarn Duong [aut, cre], Matt Wand [ctb], Jose Chacon [ctb], Artur Gramacki [ctb]
Initial release
2021-02-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.