Learn R Programming

bda (version 10.1.9)

bde: Density Estimation for Binned Data

Description

Returns x and y coordinates of the density estimate of the probability density based on binned data.

Usage

bde(x, counts, nclass, breaks, bw,
      type="kde", from, to, gridsize=512L,
      lbound, conf.level)

Arguments

x

A vector of sample data. 'NA' values will be automatically removed.

counts

vector of frequencies (counts) of different bins. Missing values are not allowed.

nclass

Number of classes

breaks

vector of breaking points.

bw

Bin (class) width.

lbound

A numerical value showing where the distribution is bounded to the left. The distribution is not left bounded if lbound is missing.

from,to,gridsize

parameters to define fine equally spaced grid points at which to estimate the density.

type

Distribution family or smoothing type used to fit the histogram.

conf.level

Confidence level for the pointwise/simultaneous confidence bands.

Value

a list containing the following components:

x,y

vector of sorted x values at which the density estimate y was computed.

type, npar, pars

If parametric method is used, return the type of distribution family in type, and estimated parameters in pars.

ucb, lcb, conf.level

conf.level gives the confidence level; lcb and ucb are the corresponding confidence bands for the density function.

Details

Missing values are not allowed. A specific family of distribution is fitted to the a set of non-negative data that have binned. Families of distributions supported include:

ewdexponentiated Weibull distribution;

weibullWeibull distribution;

dagumType I Dagum distribution.

Some histogram-based smoothing methods include:

smkde,smoothkdeBlower and Kelsall's smooth KDE.

histosplineMinnottee (1996,1998)'s histospline estimate.

bootkdeTwo-stage bootstrap KDE.

npr/lpr/root-unrootEstimate the density via local polynomial regression using root-unroot.

fnmm/nmix/normmix/nmFitting finite normal mixture model using EM algorithm.

References

Wang, B. (2014). JSS paper.

Blower G, Kelsall J (2002). "Nonlinear kernel density estimation for binned data: convergence in entropy." Bernoulli, 8(4), 423-449.

Minnottee MC (1996). "The bias-optimized frequency polygon." Comput. Statist., 11, 35-48.

Minnottee MC (1998). "Achieving higher-order convergence rates for density estimation with binned data." JASA, 93(442), 663-672.

Wang, B. and Wertelecki, W. (2012) Density Estimation for Data With Rounding Errors. Computational Statistics and Data Analysis, doi: 10.1016/j.csda.2012.02.016.

Examples

Run this code
# NOT RUN {
  data(hhi)
# }

Run the code above in your browser using DataLab