Description Usage Arguments Value Note References See Also Examples

View source: R/checkHistogram.R

Give the locations (i.e. intervals) where the multiscale constraint is violated, and the change-points that are removable.

1 2 |

`h` |
a numeric vector specifying values of a histogram at sample points or a |

`y` |
a numeric vector containing the data. |

`alpha` |
significance level; if |

`q` |
threshold of the multiscale constraint. |

`plot` |
logical. If |

`verbose` |
logical. If |

`xlim, ylim` |
numeric vectors of length 2 (default |

`xlab` |
a title for the |

`ylab` |
a title for the |

`yaxt` |
A character which specifies the |

`...` |
further arguments and |

A data frame provides the intervals where the corresponding local side constraint is violated; an empty data frame if there is no violation. The data frame constains the following four columns

`leftIndex` |
left index of an interval |

`rightIndex` |
right index of an interval |

`leftEnd` |
left end point of an interval |

`rightEnd` |
right end point of an interval |

Only the intervals on which the input histogram is constant will be checked!

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 | ```
set.seed(123)
# Data: mixture of Gaussians 1/3 N(0,0.5) + 1/3 N(5,1) + 1/3 N(15,2)
n = 500
y = rmixnorm(n, mean = c(0, 5, 15), sd = c(0.5, 1, 2))
# Oracle density
sy = sort(y)
ho = dmixnorm(sy, mean = c(0, 5, 15), sd = c(0.5, 1, 2))
# R default histogram
h = hist(y, plot = FALSE)
# Check R default histogram to local multiscale constriants
b = checkHistogram(h, y)
lines(sy, ho, col = "red")
legend("topright", c("R-Histogram", "Truth"), col = c("black", "red"), lty = c(1,1))
``` |

essHist documentation built on April 9, 2018, 5:04 p.m.

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.