Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
dynamic binning?

Subject: dynamic binning?

From: Jeremy

Date: 18 Apr, 2011 03:28:04

Message: 1 of 3

Hi everyone. Wondering if anyone had any thoughts about this...

I've got a bunch of sets of discrete data points, with each point in the x-dimension having an intensity in the y-dimension. I want to bin the data, summing the intensities of data points that are binned together. That is straightforward to do.

But, I want the bins to be non-uniform, meaning that the further to the left on the x-axis, I want the bins to be narrower, and the further to the right on the x-axis, I want the bins to be wider. Anyone have any thoughts on the right way to do this? I'd prefer to avoid discretizing the changes in bin width, meaning that I would prefer to apply a smooth gradient of bin widths.

Does that make sense?
Thanks,
Jeremy

Subject: dynamic binning?

From: Roger Stafford

Date: 18 Apr, 2011 04:15:21

Message: 2 of 3

"Jeremy " <jeremy.brower@asu.edu> wrote in message <iogb44$b5b$1@fred.mathworks.com>...
> Hi everyone. Wondering if anyone had any thoughts about this...
>
> I've got a bunch of sets of discrete data points, with each point in the x-dimension having an intensity in the y-dimension. I want to bin the data, summing the intensities of data points that are binned together. That is straightforward to do.
>
> But, I want the bins to be non-uniform, meaning that the further to the left on the x-axis, I want the bins to be narrower, and the further to the right on the x-axis, I want the bins to be wider. Anyone have any thoughts on the right way to do this? I'd prefer to avoid discretizing the changes in bin width, meaning that I would prefer to apply a smooth gradient of bin widths.
>
> Does that make sense?
> Thanks,
> Jeremy
- - - - - - - - -
  It should be relatively easy to devise some function that allows you to create smoothly varying bin widths. Their accumulated values give the 'edges' data needed for applying 'histc' to your x-dimension data. The result would be bin counts and bin indices. From this you can perform the "summing" on y values you need (though I suspect you really want mean values rather than sums.) (I can foresee the need for 'accumarray' here.) If you say that with uniform bin widths this is "straightforward", then with varying bin widths this should be equally so.

Roger Stafford

Subject: dynamic binning?

From: Jeremy

Date: 20 Apr, 2011 19:31:05

Message: 3 of 3

Thanks for the input Roger. I've got it all implemented and working pretty close to how I originally had it working in my mind.


> It should be relatively easy to devise some function that allows you to create smoothly varying bin widths. Their accumulated values give the 'edges' data needed for applying 'histc' to your x-dimension data. The result would be bin counts and bin indices. From this you can perform the "summing" on y values you need (though I suspect you really want mean values rather than sums.) (I can foresee the need for 'accumarray' here.) If you say that with uniform bin widths this is "straightforward", then with varying bin widths this should be equally so.
>
> Roger Stafford

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us