I don't have a good idea for plotting that second function on the y
axis, but Mathematica has a built-in function for doing these sort of variable transformations on distributions: TransformedDistribution
. In the example in the book, y
is distributed as LogisticSigmoid[x - 5]
where x
follows a normal distribution. You can define this as:
dist = TransformedDistribution[
LogisticSigmoid[x - 5],
x \[Distributed] NormalDistribution[6, 1]
]
You can plot its PDF
:
Plot[Evaluate[PDF[dist, y]], {y, 0, 1}]
and you can draw samples from it:
RandomVariate[dist, 10]
Find the mode of the distribution:
Maximize[PDF[dist, y], y]
N[%]