# Log-uniform distributions

I am having some difficulty understanding what log uniform distributions are.

Suppose that $\log X$ is uniformly distributed on the interval $[1,e]$. How do I describe $P(X=x)$? It seems like there is more probability mass on the lower numbers so that X itself is not uniformly distributed, but I am having difficulty formalizing this argument.

• Change-of-variable formula (with some thought regarding the support of X)?... but $P(X=x)$ is non-zero only for discrete r.v.'s. Is $X$ a discrete r.v.? Jul 31, 2014 at 1:07
• I agree with Alecos that you need the density function. I bet you can figure out the cdf $F(x) = P(X \le x)$, then get the density. Jul 31, 2014 at 1:27

Your definition of $X$ suggests that $X$ is a continuous random variable, but your question $\Pr[X = x]$ suggests you wish to treat it as a discrete variable. If you were asking for the probability density function of $X$, rather than the probability mass function, then we could proceed naturally using a transformation, since $\log$ is a monotone function: if $Y = g^{-1}(X) = \log X$, then $X = g(Y) = e^Y$ and $$f_X(x) = f_Y(g^{-1}(x)) \left| \frac{dg^{-1}}{dx} \right| = \ldots$$ This of course means that $X$ is not uniformly distributed.

• Thanks. When I carry this through I find that the density is some constant over $x$inside the interval and zero outside. Is that correct? Jul 31, 2014 at 14:01
• Did you actually apply @heropup's suggestion? What is the density of $\log X$? What is $\left| \frac{dg^{-1}}{dx} \right|$? And no, the density of $X$ is not a constant density -this would mean that it would also be uniform, and it is not. And what is the support of $X$? Aug 1, 2014 at 3:04
• @AlecosPapadopoulos The OP wrote "the density is some constant over $x$," which I interpreted to mean $f_X(x) = c/x$ for some constant $c$. This is correct. Aug 1, 2014 at 3:35
• Hmmm, yes "something over x" means also that. Aug 1, 2014 at 10:12
• I don't disagree with what you've written, however the steps that @heropup has laid out is all but a full solution. At this point, what's left isn't an exercise in statistical thinking, so much as it is an exercise in plugging in the various pieces and performing the prerequisite calculus... I don't think we're robbing the rest of the world of a valid chance to thoughtfully further inquire into this question by completing the derivation (given how far it's already come). I welcome a valid argument to the contrary, however. Jan 15, 2016 at 21:49

I like @heropup's answer, but am slightly bothered by the fact that he didn't finish the derivation for the OP. To enrich his answer, I'd like to add the following picture, and some comments on the above answer:

If you follow @heropup's derivation, you'll find that

$$f_{X}(x) = \frac{I_{[e, e^e]}(x)}{x(e-1)}$$

More generally, if $Y \sim Unif(a,b)$, such that $Y = log(X)$ for some random variable $X$, then

$$f_{X}(x) = \frac{I_{[e^a, e^b]}(x)}{x(b - a)}$$

For the sake of validating your intuition, I've made the figure of $Y \sim Unif(0,1)$, so that we see the originating random variable is actually defined on $[1, e]$ and looks something like $1/x$. As you pointed out, there is, indeed, more mass at the "beginning" of $X$'s domain and from the picture of the CDF, alone, we can see that $X$ cannot also be uniformly distributed (since the CDF is not a straight line).

I hope this fleshes out a bit of the above answer...

edit: you can find the code to make this picture here.

• What does "$\delta$" mean?
– whuber
Jan 15, 2016 at 18:25
• $\delta(x)$ is the delta function, and takes value 1 when $x=0$ and 0, otherwise. I'm abusing it here to take on the value 1 whenever the statement inside of it evaluates to true. In our case, it is 1 (or "on") whenever $x$ is an element of the stated set, and 0 (or "off") when it isn't. It's just a way to explicitly state the support of a function. Jan 15, 2016 at 21:43
• Thank you for the explanation. Whenever you use notation that is idiosyncratic or might not be well known, it's a good idea to explain it in your answer--especially when the question is focusing on how one "describes" a distribution. A more common notation, especially in statistics, is to use "$I$" as a mnemonic for an indicator function, as in $I_{[e^a,e^b]}(x)$, which is not an abuse of notation at all. (Mathematicians often use "$\chi$" but that could cause confusion in some statistical contexts.)
– whuber
Jan 15, 2016 at 22:17
• As a former mathematics/statistics student, I remember being exposed to a myriad of notations for the indicator function (sometimes $I$, sometimes $\mathbf{1}$, sometimes the hacky $\delta$). I didn't realize this was idiosyncratic to my education... Anyway, the answer has been edited to reflect your convention. Jan 16, 2016 at 12:27
• Personally, I'm not fussy about notation. As a moderator, I only check that questions and answers can be readily understood by most readers and are not open to misinterpretation. $\delta$ would be fine provided it's explained. The "$I$" notation is by far the most prevalent on this site.
– whuber
Jan 16, 2016 at 14:55
{"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 1, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0}