lpdensity: Local Polynomial Density Estimation and Inference

Density estimation and inference methods are widely used in empirical work. When the data has compact support, as all empirical applications de facto do, conventional kernel-based density estimators are inapplicable near or at the boundary because of their well known boundary bias. Alternative smoothing methods are available to handle boundary points in density estimation, but they all require additional tuning parameter choices or other typically ad hoc modifications depending on the evaluation point and/or approach considered. This article discusses the R and Stata package lpdensity implementing a novel local polynomial density estimator proposed in Cattaneo, Jansson and Ma (2019), which is boundary adaptive, fully data-driven and automatic, and requires only the choice of one tuning parameter. The methods implemented also cover local polynomial estimation of the cumulative distribution function and density derivatives, as well as several other theoretical and methodological results. In addition to point estimation and graphical procedures, the package offers consistent variance estimators, mean squared error optimal bandwidth selection, and robust bias-corrected inference. A comparison with several other density estimation packages and functions available in R using a Monte Carlo experiment is provided.

[1]  Matthew P. Wand,et al.  Kernel Smoothing , 1995 .

[2]  Max H. Farrell,et al.  nprobust: Nonparametric Kernel-Based Estimation and Robust Bias-Corrected Inference , 2019 .

[3]  Jianqing Fan,et al.  On automatic boundary corrections , 1997 .

[4]  Rohana J. Karunamuni,et al.  On kernel density estimation near endpoints , 1998 .

[5]  Jeffrey S. Racine,et al.  Nonparametric kernel smoothing methods for mixed data types , 2014 .

[7]  Jeffrey S. Racine,et al.  Nonparametric Econometrics: The np Package , 2008 .

[8]  Matias D. Cattaneo,et al.  Simple Local Polynomial Density Estimators , 2018, Journal of the American Statistical Association.

[9]  Tarn Duong,et al.  ks: Kernel Density Estimation and Kernel Discriminant Analysis for Multivariate Data in R , 2007 .

[10]  M. Wand Functions for Kernel Smoothing Supporting Wand & Jones (1995) , 2015 .

[11]  Max H. Farrell,et al.  On the Effect of Bias Estimation on Coverage Accuracy in Nonparametric Inference , 2015, Journal of the American Statistical Association.

[12]  Max H. Farrell,et al.  Coverage error optimal confidence intervals for local polynomial regression , 2018, Bernoulli.

[13]  Jianqing Fan,et al.  Local polynomial modelling and its applications , 1994 .

[14]  Rohana J. Karunamuni,et al.  On boundary correction in kernel density estimation , 2005 .

[15]  Density estimation in R , 2014 .

[16]  Liang Peng,et al.  REGRESSION MODELING FOR NONPARAMETRIC ESTIMATION OF DISTRIBUTION AND QUANTILE FUNCTIONS , 2002 .