The file is called logbin.m and can be downloaded for free.Hope this helps!

  • Context: Undergrad 
  • Thread starter Thread starter NoobixCube
  • Start date Start date
  • Tags Tags
    Data Fit Theory
Click For Summary

Discussion Overview

The discussion revolves around the use of log bins for analyzing data that varies over multiple magnitudes. Participants explore methods for binning the data and assigning appropriate error values to fit the data to theoretical models, such as power laws.

Discussion Character

  • Exploratory
  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant inquires about the process of binning data using log bins and how to assign errors for fitting to a theory.
  • Another participant suggests rescaling the data using y=log10(x) and taking equal intervals in the binned y data.
  • Concerns are raised regarding the assignment of errors, particularly when the expected count within a bin is less than one, which could lead to unphysical results.
  • A participant expresses uncertainty about the statistical aspects of error assignment and invites others with more expertise to contribute.
  • Several participants share links to MATLAB scripts that may assist in implementing log binning techniques.

Areas of Agreement / Disagreement

Participants have not reached a consensus on the best method for assigning errors in log binning, and multiple viewpoints regarding the approach to binning and error calculation remain present.

Contextual Notes

There are unresolved questions regarding the statistical treatment of errors, particularly in cases of low expected counts, and the discussion does not clarify the assumptions underlying the proposed methods.

Who May Find This Useful

Researchers or students working with data that spans multiple magnitudes, particularly those interested in statistical methods for data analysis and fitting theoretical models.

NoobixCube
Messages
154
Reaction score
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!
 
Physics news on Phys.org
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.
 
Hey Redbelly98,

thanks for your reply :) I will look into it and post back with results.
 
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
 
Last edited by a moderator:
NoobixCube said:
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

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:

Similar threads

Replies
28
Views
4K
  • · Replies 37 ·
2
Replies
37
Views
5K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 26 ·
Replies
26
Views
3K
  • · Replies 18 ·
Replies
18
Views
3K
Replies
8
Views
2K
  • · Replies 16 ·
Replies
16
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 13 ·
Replies
13
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K