Last data update: 2014.03.03

R: Average Shifted Histograms From a Histogram.
ASHR Documentation

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.

Author(s)

Murray Stokely mstokely@google.com

References

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

See Also

histogramtools-package, ash1, and hist.

Examples

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")

Results


R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> library(HistogramTools)
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/HistogramTools/ash.Rd_%03d_medium.png", width=480, height=480)
> ### Name: ASH
> ### Title: Average Shifted Histograms From a Histogram.
> ### Aliases: HistToASH
> ### Keywords: nonparametric
> 
> ### ** Examples
> 
> 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")
[1] "ash estimate nonzero outside interval ab"
> 
> 
> 
> 
> 
> dev.off()
null device 
          1 
>