R/ash1_wgt.R
ash1_wgt.RdCalculate the average shifted histogram estimate of a density based on one-dimensional data from a survey design with weights.
Vector used to estimate the density. NA values are allowed.
Vector of weights for each observation from a probability sample. The default assigns equal weights (equal probability).
Number of empty bins to add to the ends when the range is not
completely specified. The default is 5.
Number of bins for density estimation. The default is 50.
Optional range for support associated with the density. Both
values may be equal to NA. If equal to NA, then corresponding limit will
be based on nicerange(). The default is NULL.
Type of support. If equal to "Continuous", then data are
from a continuous distribution. If equal to "Ordinal", then data are from
a discrete distribution defined for integers only. The default is
"Continuous".
List containing the ASH density estimate. List consists of
tcenx-coordinate for center of bin
fy-coordinate for density estimate height
Scott, D. W. (1985). "Averaged shifted histograms: effective nonparametric density estimators in several dimensions." The Annals of Statistics 13(3): 1024-1040.