Implements the Shimazaki-Shinomoto method for optimizing the
bin width of histograms and the bandwidth of kernel density estimators.
The framework minimizes the expected Mean Integrated Squared Error (MISE)
and supports both 1D and 2D distributions, fixed and locally adaptive
estimators, bootstrap confidence intervals, and 'OpenMP'-accelerated 'C++' 'backends'. Ideally suited for time-dependent rate estimation and
identifying intrinsic data structures. For more details see Shimazaki and
Shinomoto (2007)
The sshist package implements state-of-the-art algorithms for optimal non-parametric density estimation based on the framework developed by Hideaki Shimazaki and Shigeru Shinomoto (2007, 2010). The core optimization principle is to find the parameters that minimize the expected Mean Integrated Squared Error (MISE) between the estimated density and the true, unknown underlying distribution.
By utilizing purely data-driven optimization, this package avoids subjective choices for bin widths or kernel bandwidths, making it highly robust—especially for data with complex, multimodal, or heavy-tailed structures.
| Function | Estimator Type | Dimension | Bandwidth / Bin Selection |
|---|---|---|---|
sshist |
Histogram | 1D | Fixed (single optimal bin width) |
sshist_2d |
Histogram | 2D | Fixed independent bin width per axis |
sskernel |
Kernel Density | 1D | Fixed global bandwidth |
ssvkernel |
Kernel Density | 1D | Locally adaptive variable bandwidth |
sskernel2d |
Kernel Density | 2D | Fixed global isotropic bandwidth |
ssvkernel2d |
Kernel Density | 2D | Locally adaptive bivariate bandwidth |
You can install the stable version of sshist from CRAN:
install.packages("sshist")
Alternatively, you can install the development version directly from GitHub using devtools:
# install.packages("devtools")
devtools::install_github("celebithil/sshist")
Shimazaki, H. and Shinomoto, S. (2007). A method for selecting the bin size of a time histogram. Neural Computation, 19(6), 1503–1527. doi:10.1162/neco.2007.19.6.1503
Shimazaki, H. and Shinomoto, S. (2010). Kernel bandwidth optimization in spike rate estimation. Journal of Computational Neuroscience, 29(1-2), 171–182. doi:10.1007/s10827-009-0180-4