Data binning

  • Thread starter NoobixCube
  • Start date
  • #1
NoobixCube
155
0
Hey all,

I have a bunch of data that varies over many magnitudes. I was hoping to use log bins to capture the short and long term features of the data. My question is, how do I bin the data, and how do I assign appropriate errors so that I can fit the data to some theory (maybe a power law)?

Cheers!
 

Answers and Replies

  • #2
Redbelly98
Staff Emeritus
Science Advisor
Homework Helper
Insights Author
12,152
170
Probably the most straightforward method is to rescale the data as y=log10(x), and then take equal intervals in binning the y data.

Good question about the errors. I'm not absolutely sure, but I believe that the error would be ± the square root of the expected number of counts within a bin, at least when that count total is considerably greater than 1. This becomes problematic when the expected count is less than 1, for example 0.25±0.5 allows for negative counts, an unphysical result.

Perhaps somebody who knows statistics better than I can provide a more accurate answer.
 
  • #3
NoobixCube
155
0
Hey Redbelly98,

thanks for your reply :) I will look into it and post back with results.
 
  • #4
NoobixCube
155
0
I have managed to find this website with MATLAB scripts relevant to my initial query, that may help people in the future who are asking the same, or a similar question:

http://www-personal.umich.edu/~ladamic/courses/si614w06/matlab/index.html [Broken]
 
Last edited by a moderator:
  • #5
NoobixCube
155
0
I have managed to find this website with MATLAB scripts relevant to my initial query, that may help people in the future who are asking the same, or a similar question:

http://www-personal.umich.edu/~ladamic/courses/si614w06/matlab/index.html [Broken]

Also,

I have modified the scripts on the page given in my previous reply, and uploaded a MATLAB file to MATLAB Central

http://www.mathworks.com/matlabcentral/fileexchange/27176-log-binning-of-data
 
Last edited by a moderator:

Suggested for: Data binning

  • Last Post
Replies
3
Views
421
  • Last Post
Replies
18
Views
2K
  • Last Post
2
Replies
37
Views
3K
Replies
5
Views
525
  • Last Post
Replies
4
Views
556
  • Last Post
Replies
4
Views
548
  • Last Post
Replies
13
Views
693
Replies
1
Views
400
  • Last Post
Replies
17
Views
744
Replies
7
Views
501
Top