I have generated a list of 100k numbers, and want to know their distribution. By looking at the numbers, the trend is very different from that generated by Histogram[], in log-log scale.
Another problem is that if I don't use log scale, it gives me a blank plot. Really weird.
bmax[θw_] := (1.14*10^9)/Sin[θw/2]^(9/7);
db = 10^-5;
Pb[θw_, b_] := (2 b db)/bmax[θw]^2;
a0[θw_, b_] := (9*10^10)/((2.51*10^63)/(Sin[θw/2]^7 b^7)-Sin[θw/2]^2);
a0sim = {};
n = 10^5;
m = 0;
While[m < n, {θw = π Random[];
b = bmax[θw] Random[];
If[Random[] <= Pb[θw, b]*10^13, {AppendTo[a0sim, a0[θw, b]], m++}]
}
];
Histogram[a0sim]
This gives an empty plot, while:
Histogram[a0sim,ScalingFunctions -> {"Log", "Log"}]
gives the following plot
But if I Sort[a0sim]
and scroll down the list, it is obvious that most element fall in around 10^10, but whatever, it cannot be nothing before 10^12 as in the plot.
Don't know what happened here.
Histogram[a0sim]
. What version are you using? Re: the disappearing elements in theLogLog
plot: my first guess is that there's something weird about the bins. As far as I know (which isn't very far),ScalingFunctions
only affects the display, not the bins. So if your bin widths are of the order 10^10 or 10^11, there's only going to be one bin covering most of the plot. Not sure why it's not showing up (I get a single spike in your empty half). $\endgroup$SmoothHistogram
andSmoothDensityHistogram
) which destroys the ability to make "equal total area" comparisons among datasets. (Just because there's an option to do so doesn't mean that one should.) What does make sense for this data is to take the log of the data and then produce the histogram:Histogram[Log[a0sim]]
. $\endgroup$