1

In Machine Learning, during hyperparameter tuning, if you don't have a clue about the scale of the hyperparameter that you are trying to tune, it is common practice to perform grid search with roughly geometrically increasing values, for example: [0.01, 0.03, 0.1, 0.3, 1.0, 3.0, 10.0, 30.0, 100.0].

Using NumPy, I can sample 1,000 numbers from such a distribution like so:

x = np.rand(1000) * 10 - 5  # x is uniform random in [-5, 5]
y = np.exp(x)

I suppose this distribution is well known. If so, what is its name? I would like to find it in the list of distribution functions in scipy.

Edit

I'm not very familiar with the mathematical notations, but I guess it might look something like this:

I'm looking for the name of the random distribution $ Y = \exp(X) $

with $X \sim\ \mathcal{U}(-5, 5)$

where $\mathcal{U}$ represents the uniform distribution,

Thanks!

MiniQuark
  • 155

1 Answers1

1

I believe it's the reciprocal distribution.

Let $U\sim \mathcal{U}(a,b)$ and $X=\exp(U)$. Then, the CDF is given by: $$ F_X(x)=P(X\leq x)=P(U\leq \ln(x))=\frac{\ln(x) - a}{b-a} $$ using the CDF of $U$. Then, the PDF is: $$ f_X(x) = \frac{\partial}{\partial x} \frac{\ln(x) - a}{b-a} = \frac{1}{(b-a)x} $$ where $e^a \leq x \leq e^b$.

It's conveniently implemented in scipy :). See also here.

user3658307
  • 10,433