Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

histss

Histogram Bin-width Optimization


Description

Method for selecting the bin size of time histograms.

Usage

histss(x, n = 100, plotting = FALSE)

Arguments

x

numeric vector or matrix.

n

maximum number of bins.

plotting

logical; shall a histogram be plotted.

Details

Bin sizes of histograms are optimized in a way to best displays the underlying spike rate, for example in neurophysiological studies.

Value

Returns the same list as the hist function; the list is invisible if the histogram is plotted.

References

Shimazaki H. and S. Shinomoto. A method for selecting the bin size of a time histogram. Neural Computation (2007) Vol. 19(6), 1503-1527

See Also

Examples

x <- sin(seq(0, pi/2, length.out = 200))
H <- histss(x, n = 50, plotting = FALSE)
## Not run: 
plot(H, col = "gainsboro")  # Compare with hist(x), or
hist(x, breaks = H$breaks)  # the same 
## End(Not run)

pracma

Practical Numerical Math Functions

v2.3.3
GPL (>= 3)
Authors
Hans W. Borchers [aut, cre]
Initial release
2021-01-22

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.