Hi list. I'm new here. Medium skills with Mathematica.
Histogram and HistogramList both have allowable forms such as this:
HistogramList[some_list, bspec]
where bspec can be the number of bins. The actual number of bins used seems to have a very casual relationship to the number of bins requested. For example, the following bit of code
numBins = 1;
uniformSamples = RandomReal[{-Pi/2, Pi/2}, 1000];
list = HistogramList[uniformSamples, numBins];
{numBins, Length[list[[1]]] - 1}
returns the following numbers for {number of bins requested, number of bins used} for a few choices of numBins. Note that there are one fewer bins than bin delimiters (edges), thus Length[list[[1]]] - 1.
{1, 1}
{2, 2}
{3, 2}
{4, 4}
{5, 4}
{6, 8}
{7, 8}
{8, 8}
{9, 8}
{10, 16}
{11, 16}
{16, 16}
{17, 16}
{21, 16}
{22, 32}
It seems that there is something that is overriding the input request and instead returning bin numbers that are powers of two.
How can I get the number of bins that I request without ginning up my own list of bin edges? And who knows if that would even work. I can't see this behavior in the documentation for these functions which states unambiguously, "The following bin specifications bpsec can be given: n use n bins"
Jerry