摘要

The weighted kernel density estimator is an attractive option for shape-restricted density estimation, because it is simple, familiar, and potentially applicable to many different shape constraints. Despite this, no reliable software implementation has appeared since the method's original proposal in 2002. We found that serious numerical and practical difficulties arise when attempting to implement the method. We overcame these difficulties and in the process discovered that the weighted method and our own recently proposed method-controlling the shape of a kernel density using an adjustment curve-can be unified in a single computational framework. This article describes our findings and introduces the R package scdensity, which can be used to easily obtain density estimates that are unimodal, bimodal, symmetric, and more.