Transformation of a Random Variable Demo

Generates input/output pdf/CDFs for any writeable mixed pdf inputs and transformation function f(x).

You are now following this Submission

This GUI demo shows how a random variable, X, is transformed to a new random variable, Z, by a function z=f(x). The random variable X can have a uniform probability density function (pdf), a Gaussian pdf, or ?Other pdf? given by a user specified MATLAB expression. A pseudo-random number generator is used to generate the random variable(RV) X samples. The sample pdf of X is plotted in the lower right plot, the function f(x) is plotted in the upper right plot, and the sample pdf of Z is plotted in the upper left plot. A single random variable sample can be generated and followed through the transformation, or 5000 or 50,000 samples may be generated. Any multiple of any of these may be generated and displayed by repeated clicking on the appropriate button. A Check Box allows display of the cumulative distribution functions (CDF) rather than the pdfs if desired. Examples are included in the information given in the description available by pressing the INFO button.

Cite As

Filson Glanz (2026). Transformation of a Random Variable Demo (https://www.mathworks.com/matlabcentral/fileexchange/6030-transformation-of-a-random-variable-demo), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Random Number Generation in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with any release

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.0.0.0