Skip to main content
added 1 character in body
Source Link

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;10879;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin sizewidth of 4 with an offset of 3 captures a maximum bin count of 14, and a bin sizewidth of 4851 with an offset of 334 captures a maximum bin count of 2026.

Selecting from a where (334 + 4851 * 9) <= a < (334 + 4851 * 10) finds 2026 items. The rest are outliers. How narrow you want the bins is a subjective choice.

enter image description here

enter image description hereenter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin size of 4 with an offset of 3 captures a maximum bin count of 14, and a bin size of 48 with an offset of 33 captures a maximum bin count of 20.

Selecting from a where (33 + 48 * 9) <= a < (33 + 48 * 10) finds 20 items. The rest are outliers. How narrow you want the bins is a subjective choice.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10879;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin width of 4 with an offset of 3 captures a maximum bin count of 14, and a bin width of 51 with an offset of 4 captures a maximum bin count of 26.

Selecting from a where (4 + 51 * 9) <= a < (4 + 51 * 10) finds 26 items. The rest are outliers. How narrow you want the bins is a subjective choice.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]
added 78 characters in body
Source Link

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin size of 4 with an offset of 3 captures a maximum bin count of 14, and a bin size of 48 with an offset of 33 captures a maximum bin count of 20.

Selecting from a where (33 + 48 * 9) <= a < (33 + 48 * 10) finds 20 items. The rest are outliers. How narrow you want the bins is a subjective choice.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin size of 4 with an offset of 3 captures a maximum bin count of 14, and a bin size of 48 with an offset of 33 captures a maximum bin count of 20.

Selecting from a where (33 + 48 * 9) <= a < (33 + 48 * 10) finds 20 items.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin size of 4 with an offset of 3 captures a maximum bin count of 14, and a bin size of 48 with an offset of 33 captures a maximum bin count of 20.

Selecting from a where (33 + 48 * 9) <= a < (33 + 48 * 10) finds 20 items. The rest are outliers. How narrow you want the bins is a subjective choice.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]
Source Link

You could divide the data into equal bins to find the bin size (and offset) that yields a suitable maximum bin count. Here is an example using the following data.

a = {463, 463, 512, 512, 512, 512, 512, 512, 512,
     512, 513, 513, 513, 513, 10462, 10462, 880, 880,
     929, 929, 929, 929, 929, 929, 929, 929, 930, 930,
     930, 930, 10879, 10879, 181, 181, 230, 230, 230, 
     230, 230, 230, 230, 230, 231, 231, 231, 231, 10180,
     10180, 416, 416, 465, 465, 465, 465, 465, 465, 465,
     465, 466, 466, 466, 466, 10415, 10415};

maxA = 10415;

Increasing the bin count from 1 to 100 (offsetting the bin start to capture all variations) produces the following plot of maximum bin count. For example, a bin size of 4 with an offset of 3 captures a maximum bin count of 14, and a bin size of 48 with an offset of 33 captures a maximum bin count of 20.

Selecting from a where (33 + 48 * 9) <= a < (33 + 48 * 10) finds 20 items.

enter image description here

enter image description here

Mathematica code for the above

largestBinWidth = 100;

counts = Table[
   Table[
    {binsize, offset, 
     Max[BinCounts[a, {offset, maxA + offset, binsize}]]},
    {offset, -binsize, binsize}],
   {binsize, 1, largestBinWidth}];

maxcounts = Last[SortBy[#, Last]] & /@ counts;

ListLinePlot[maxcounts[[All, {1, 3}]],
 PlotRange -> All, AxesOrigin -> {0, 0},
 AxesLabel -> {"Bin width", "Max bincount"}]