I am currently working on a project the includes fitting. For the fitting I would like to try uniform random starting parameters. The possible fit parameters can lie in quite a large range, for example 10^-15 to 10^15 while others can lie in the range of -1 to 1. So quite diverse.
When I try to create random numbers that reflect this range like
Number = Rnd(0, 1) * (UpperLimit - LowerLimit) + LowerLimit
This approach however is pretty useless for the large range. Here pretty much all resulting random numbers are very large. I have yet to see a number smaller than 10^12 for the above range.
For the large range I can reduce the problem by using logarithms:
Number = 10^(Rnd(0, 1) * (Lg(UpperLimit) - Lg(LowerLimit)) + Lg(LowerLimit))
This now produces useful numbers over the whole logarithmic range yet it does not work for negative ranges or zero.
I think I haven't really understood the basic concepts. If you plot the large numbers in a point plot they seem very uniform, yet they only reflect the large values. Does that mean that small numbers are less likely to turn up?
The logarithmic numbers of course only look uniform in logarithmic scaling.
I can't be the first person to run unto these problems. How are random numbers usually chosen? In the first step I don't care about quality of randomness. I just want to reflect larger and smaller number ranges including negative and 0 randomly.
If I my explaination was to confusing please leave a comment and I will try to elaborate. As you may have noticed from the question I am note very well educated in statistics. So if you could keep it in Layman's terms I would be very grateful. Thanks in advance.
0.001
less likely to pop up in the range (0,1) than say for example0.64
? $\endgroup$0.640
are more likely to pop up than numbers that look like0.001
. I'm not sure that I completely follow your question / the problem you're having. Your top code should work fine. What language are you using? $\endgroup$