2
$\begingroup$

Suppose I have the following equation:

a = -(Log[(1 - b)/b]/Log[10])

which is visualized as

enter image description here

Suppose further that $b$ is drawn from a uniform distribution with minimum $L$ and maximum $H$, where $0<L<H<1$. For example $L = 0.6$ and $H = 0.8$.

How can I use Mathematica to find the associated distribution of $a$?

$\endgroup$
2
$\begingroup$

You can use TransformedDistribution:

a = -(Log[(1 - b)/b]/Log[10]);
l = .6; h = .8;
td = TransformedDistribution[a, Distributed[b, UniformDistribution[{l, h}]]];

PDF[td, x] // TeXForm

$\small\begin{cases} \frac{5.75646 e^{2.30259 x}}{0.5\, +1. e^{2.30259 x}+0.5 e^{4.60517 x}} & 0.176091<x<0.60206\land 1. e^{2.30259 x}\geq 1.5\land e^{-2.30259 x}\geq 0.25 \\ 0 & \text{True} \end{cases}$

Plot[Evaluate@PDF[td, x], {x, 0, 1}]

enter image description here

ClearAll[pdF]
pdF[l_, h_] := PDF @ TransformedDistribution[-(Log[(1 - b)/b]/Log[10]), 
        Distributed[b, UniformDistribution[{l, h}]]];

Manipulate[Plot[Evaluate[pdF[l, h][x]], {x, -1, 1}, 
 Filling -> Axis, PlotLabel -> Style[Row[{"{l, h} =", {l, h}}], 16], PlotRange -> {0, 2}],
 {{l, .2}, 0, 1}, {{h, .6}, l, 1}]

enter image description here

$\endgroup$
  • $\begingroup$ Beat me to it... Yep: again! If we were gunslingers in the wild west, you would (it seems) always beat me by just a fraction of a second! (No wonder your reputation is 157k!) $\endgroup$ – David G. Stork Aug 29 '18 at 21:47
  • 1
    $\begingroup$ @David, again?:) $\endgroup$ – kglr Aug 29 '18 at 21:48
  • $\begingroup$ What does the y-axis show here? I was expecting probabilties. $\endgroup$ – user120911 Aug 30 '18 at 6:53
  • 1
    $\begingroup$ @user120911, y-axis show Probability Density Function (PDF), If you want to show Cumulative Distribution Function (CDF) you can replace PDF in the code with CDF. $\endgroup$ – kglr Aug 30 '18 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.