ash1_wgt {spsurvey} | R Documentation |
Compute the average shifted histogram (ASH) for one-dimensional weighted data
Description
Calculate the average shifted histogram estimate of a density based on one-dimensional data from a survey design with weights.
Usage
ash1_wgt(
x,
wgt = rep(1, length(x)),
m = 5,
nbin = 50,
ab = NULL,
support = "Continuous"
)
Arguments
x |
Vector used to estimate the density. |
wgt |
Vector of weights for each observation from a probability sample. The default assigns equal weights (equal probability). |
m |
Number of empty bins to add to the ends when the range is not
completely specified. The default is |
nbin |
Number of bins for density estimation. The default is |
ab |
Optional range for support associated with the density. Both
values may be equal to |
support |
Type of support. If equal to |
Value
List containing the ASH density estimate. List consists of
tcen
x-coordinate for center of bin
f
y-coordinate for density estimate height
Author(s)
Tony Olsen Olsen.tony@epa.gov
References
Scott, D. W. (1985). "Averaged shifted histograms: effective nonparametric density estimators in several dimensions." The Annals of Statistics 13(3): 1024-1040.
Examples
x <- rnorm(100, 10, sqrt(10))
wgt <- runif(100, 10, 100)
rslt <- ash1_wgt(x, wgt)
plot(rslt)