Description Details Author(s) References Examples

Provide an optimal histogram, in the sense of probability density estimation and features detection, by means of multiscale variational inference. In other words, the resulting histogram servers as an optimal density estimator, and meanwhile recovers the features, such as increases or modes, with both false positive and false negative controls. Moreover, it provides a parsimonious representation in terms of the number of blocks, which simplifies data interpretation. The only assumption for the method is that data points are independent and identically distributed, so it applies to fairly general situations, including continuous distributions, discrete distributions, and mixtures of both. For details see Li, Munk, Sieling and Walther (2016) <arXiv:1612.07216>.

Package: | essHist |

Type: | Package |

Version: | 1.2.2 |

Date: | 2019-05-10 |

License: | GPL-3 |

Index:

1 2 3 4 5 6 7 8 9 10 | ```
essHistogram Compute the essential histogram
checkHistogram Check any estimator by the multiscale confidence set
genIntv Generate the system of intervals
msQuantile Simulate the quantile of multiscale statistics
dmixnorm Compute density function of Gaussian mixtures
pmixnorm Compute distribution function of Gaussian mixtures
rmixnorm Generate random number of Gaussian mixtures
paramExample Output detailed parameters for some famous examples
``` |

Housen Li [aut, cre], Hannes Sieling [aut]

Maintainer: Housen Li <housen.li@outlook.com>

Li, H., Munk, A., Sieling, H., and Walther, G. (2016). The essential histogram. arXiv:1612.07216

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | ```
# Simulate data
set.seed(123)
type = 'skewed_unimodal'
n = 500
y = rmixnorm(n, type = type)
# Compute the essential histogram
eh = essHistogram(y, plot = FALSE)
# Plot results
# compute oracle density
x = sort(y)
od = dmixnorm(x, type = type)
# compare with orcle density
plot(x, od, type = "l", xlab = NA, ylab = NA, col = "red", main = type)
lines(eh)
legend("topleft", c("Oracle density", "Essential histogram"),
lty = c(1,1), col = c("red", "black"))
##### Evaluate other method
set.seed(123)
# Data: mixture of Gaussians "harp"
n = 500
y = rmixnorm(n, type = 'harp')
# Oracle density
x = sort(y)
ho = dmixnorm(x, type = 'harp')
# R default histogram
h = hist(y, plot = FALSE)
# Check R default histogram to local multiscale constraints
b = checkHistogram(h, y, ylim=c(-0.1,0.16))
lines(x, ho, col = "red")
rug(x, col = 'blue')
legend("topright", c("R-Histogram", "Truth"), col = c("black", "red"), lty = c(1,1))
``` |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.