The polygrams
package implements Bernstein polygrams, a class of
non-parametric density estimators for univariate densities on bounded
intervals.
Note: Bernstein polygrams are currently not described in detail anywhere, but expect a paper on arXiv shortly.
Install the package using devtools
from inside R
.
# install.packages("devtools")
devtools::install_github("JonasMoss/polygrams")
The core function polygram
calculates a Bernstein polygram from x
.
library("polygrams")
#> Loading required package: Rcpp
#> Loading required package: RcppArmadillo
hist(iris$Sepal.Length, freq = FALSE, main = "Sepal length", xlab = "Length", ylim = c(0, 0.5))
lines(polygram(iris$Sepal.Length, support = c(4, 9), s = 3))
#> [1] 0.25 0.50 0.75
rug(iris$Sepal.Length)
If you encounter a bug, have a feature request or need some help, open a Github issue. Create a pull requests to contribute. This project follows a Contributor Code of Conduct.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.