![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/955225/image.jpeg)
logarithmic binning data in matlab
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a dataset, and I have been told to bin the data using logarithmic binning.
How would I go about logarithmic binning this dataset?
0 comentarios
Respuestas (1)
John D'Errico
el 6 de Abr. de 2022
Editada: John D'Errico
el 6 de Abr. de 2022
It is not clear what you mean by logarithmic binning.
Looking at your data however, tells me that you were told to do something that makes no sense at all.
min(Q)
ans =
-4.77253376114796
max(Q)
ans =
47.6051494981383
mode(Q)
ans =
0
sum(Q == 0)
ans =
22891
numel(Q)
ans =
57158
So your data goes from negative to positive values, but there is a HUGE spike at EXACTLY 0. Literally half of your data is EXACTLY zero. Not just close. But EXACTLY so.
histogram(Q,1000)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/955225/image.jpeg)
Sorry. In no circumstances would any sort of traditional logarithmic binning like that make sense. And that HUGE spike at 0 makes things almost impossible to work with.
Could you choose bins that grow in size, as you move away from zero, in BOTH directions? Well, yes.
I would recommend you return to whoever told you to do this, and show them your actual data. Then ask them SPECIFICALLY what they think you should do. Don't just let them tell you to do something by some vague name. Have them tell you explicitly what they think is appropriate here.
0 comentarios
Ver también
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!