# Derive density of log of theta when theta follows a uniform distribution

I'm learning bayesian and I need to do some proofs that I'm not quite sure I can do. Any help will be very welcome!

If $\theta \text{~Unif}(0,1)$

What's the density of $y = - \log\theta$?

And what's density of $\theta \ (1-\theta)$?

Finally, what's density of $\log (\theta \ (1 - \theta))$?

Thanks

-

## 1 Answer

All three are similar:

1) $-\log\theta$ is monotonically decreasing on $(0;1]$ from $+\infty$ to $0$, therefore, for $y\ge 0$: $F_{-\log\theta}(y)=Pr\{-\log\theta<y\}=Pr\{\theta>e^{-y}\}=1-e^{-y}$, and density is $e^{-y}$.

2) $\theta(1-\theta)$ is increasing on $[0;1/2]$ from $0$ to $1/4$, and decreasing on $[1/2;1]$ from $1/4$ to $0$, therefore, for $y\in[0;1/4]$: $F_{\theta(1-\theta)}(y)=Pr\{\theta(1-\theta)<y\}=1-Pr\{\theta(1-\theta)>y\}=1-Pr\{\theta^2-\theta+y<0\}=1-\sqrt{1-4y}$, and density is just the derivative.

3) Similarly. I am pretty sure you can now get it done by yourself.

-
{"extraction_info": {"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": 20, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9604147672653198, "perplexity_flag": "head"}