Contents

Application - [A13]

Question
Search for the methods to generate Normal rv’s X from uniform rv’s, and simulate the following distribution: X, X², X/Y², X²/Y², X/Y .

Application

The developed application uses the Box-Muller method to generate a Normal Random Variable from two Uniform Random Variables.
The Normal Random Variable is then sampled to produce the requested distributions, which are then plotted as histograms:

../images/a13_x.png
Normal distribution
../images/a13_x2.png
Chi-squared distribution
../images/a13_xy.png
Cauchy distribution
../images/a13_xy2.png
Student’s t-distribution
../images/a13_x2y2.png
F-distribution

Library

For this application I used a self-developed library, the code for it can be found on the same Github repository used for the applications. The whole library can also be downloaded as a ZIP file from the Releases section.
Part of the code required for this task, in particular the Box-Muller implementation for a Normal Random Variable, is implemented within the library and used in the application. Therefore to have a complete overview of the code, the library’s module RandomNormal.cs implementation should be read as well.


Source Code

The application source code can be found on Github and the whole project folder is saved as a ZIP file in this Release