6.5.6.2.4.1.3. statsmodels.sandbox.nonparametric.kernels.CustomKernel.density_confint

CustomKernel.density_confint(density, nobs, alpha=0.05)[source]

approximate pointwise confidence interval for kernel density

The confidence interval is centered at the estimated density and ignores the bias of the density estimate.

not verified

Parameters:

density : array_lie

pdf of the kernel density

nobs : int

number of observations used in the KDE estimation

Returns:

conf_int : ndarray

estimated confidence interval of the density estimate, lower bound in first column and upper bound in second column

Notes

This uses the asymptotic normal approximation to the distribution of the density estimate. The lower bound can be negative for density values close to zero.