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

In summary, A user has a large range of data and wants to use log bins to capture both short and long term features. They ask for guidance on binning the data and assigning appropriate errors for fitting to a power law. Another user suggests rescaling the data and taking equal intervals in binning the y data. Concerns are raised about the accuracy of the errors when the expected count is less than 1. The original user provides a website with relevant MATLAB scripts and then shares their own modified script on MATLAB Central.
  • #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!
 
Physics news on Phys.org
  • #2
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
Hey Redbelly98,

thanks for your reply :) I will look into it and post back with results.
 
  • #4
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 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 [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:

1. What is binning data and why is it important in fitting theory?

Binning data is the process of dividing a large set of data into smaller, more manageable groups or categories. This is important in fitting theory because it allows for a clearer understanding of the relationship between variables and can help identify patterns or trends in the data.

2. How do you determine the appropriate number of bins for binning data?

The number of bins to use when binning data can vary depending on the size of the dataset and the desired level of detail. One common method is to use the square root of the total number of data points as a starting point, and then adjust as needed based on the distribution of the data.

3. What are some common methods for binning data?

Some common methods for binning data include equal-width binning, equal-depth binning, and quantile binning. Equal-width binning divides the data into a specified number of bins with equal ranges, while equal-depth binning divides the data into a specified number of bins with equal numbers of data points per bin. Quantile binning divides the data into a specified number of bins based on the quantiles of the data.

4. What are the potential drawbacks of binning data?

One potential drawback of binning data is the loss of information and detail that can occur when grouping data into categories. This can also lead to oversimplification of complex relationships between variables. Additionally, the choice of bin size and method can impact the results and interpretation of the data.

5. How can binning data be used to validate or reject a theory?

Binning data can be used to validate or reject a theory by comparing the binned data to the theoretical predictions. If the binned data aligns with the predicted trends or patterns, this can provide support for the theory. However, if the binned data does not align with the predicted trends, it may be necessary to revise or reject the theory.

Similar threads

  • Set Theory, Logic, Probability, Statistics
Replies
28
Views
2K
  • Set Theory, Logic, Probability, Statistics
2
Replies
37
Views
3K
  • Set Theory, Logic, Probability, Statistics
Replies
3
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
26
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
18
Views
2K
  • Set Theory, Logic, Probability, Statistics
Replies
8
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
13
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
12
Views
1K
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
997
  • Set Theory, Logic, Probability, Statistics
Replies
4
Views
967
Back
Top