Transformation of a Random Variable Demo

Generates input/output pdf/CDFs for any writeable mixed pdf inputs and transformation function f(x).
3.5K Downloads
Updated 13 Oct 2004

View License

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 (2024). Transformation of a Random Variable Demo (https://www.mathworks.com/matlabcentral/fileexchange/6030-transformation-of-a-random-variable-demo), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14
Compatible with any release
Platform Compatibility
Windows macOS Linux
Categories
Find more on Random Number Generation in Help Center and MATLAB Answers

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0