Group Abstract Group Abstract

Message Boards Message Boards

Plot the change of variable for a Gaussian distribution?

Posted 6 years ago
POSTED BY: Marko Grdini?
3 Replies
Posted 6 years ago

Could inputs to the distribution be transformed as well?

POSTED BY: Marko Grdini?

That is what TransformedDistribution does. It transforms x, which is the input variable to the PDF of NormalDistribution[6, 1].

Yes, this always confuses me as well whenever I haven't worked with probability distributions for a while :).

POSTED BY: Sjoerd Smit

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[%]
POSTED BY: Sjoerd Smit
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard