HistogramTools (version 0.3.2)

ASH: Average Shifted Histograms From a Histogram.

Description

Computes a univariate average shifted histogram (polynomial kernel) given a single input histogram.

Usage

HistToASH(h, m=5, kopt=c(2,2))

Arguments

h
A histogram object (created by hist) representing a pre-binned dataset.
m
optional integer smoothing parameter, passed to ash1().
kopt
vector of length 2 specifying the kernel, passed to ash1().

Details

This function takes a histogram and uses the counts as the input to the ash1() function in the ash package to compute the average shifted histogram.

References

Scott, David W. Multivariate density estimation: theory, practice, and visualization. Vol. 383. Wiley. com, 2009.

See Also

histogramtools-package, ash1, and hist.

Examples

Run this code
x <- runif(1000, min=0, max=100)
h <- hist(x, breaks=0:100, plot=FALSE)
plot(h, freq=FALSE)

# Superimpose the Average Shifted Histogram on top of the original.
lines(HistToASH(h), col="red")

Run the code above in your browser using DataLab