# NOT RUN {
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 constriants
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))
# }
Run the code above in your browser using DataLab