Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Use this link to accept the assignment and create your repository on GitHub:   https://classroom.github.com/a/NKjGQ23O  

After you accept the assignment and the repository and it exists in your GitHub then clone the repository into your working area on Rivanna. 

...

(3) Pi again!   Plotting the summary of many MC integration results.  (3 Points)


Start with the program from your repository plotting_pi_mc.py or the equivalent notebook (note that they import pi_functions.py for the calculation as we did in class).   

Add a new function or functions that make the pi estimate many times (N_MC) and that makes a plot showing a histogram for the results obtained from your N_MC estimates of pi.  For each estimate use 1000 random x,y values for N (the number of random values thrown for MC integration).  Also, on the figure draw a line at the true value of pi, write in the title on the figure: pi value estimated (average of all values), the standard deviation, and the number of N_MC used.  


NOTE:  You need to select the range and binning carefully

...

to visualize your data well.  I used 30 bins and range of 2.85-3.40.


Make this figure 4 times and save it to a file:  N_MC=10; 100 ; 1000 ; 10,000.  pi_mc_10.png, pi_mc_100.png, pi_mc_1000.png, pi_mc_10000.png


You should see the Central Limit Theorem in action!  Think about that...  


(3) The Gaussian Function (2 Points) 

Start with the program from your repository named (gaussian.py - or you may use the Jupyter Notebook) that draws a Gaussian normal distribution (mean=0, sigma=1). Fill the < 1-sigma, >1-sigma & <2-sigma, >2-sigma & < 3-sigma, , >3-sigma with different colors using the function fill_between, axvspan, or something else. Use the documentation and Google to figure out how to fill regions under the curve! Your plot should look something like this, but maybe even better!  


Image Modified

Make sure to save this plot as PlotGaussian.png.


Done? Make sure you answered any questions, then clean up your code and include some useful comments, then push: Setosa.out, Versicolour.out, Virginica.out, iris_parse.py, and iris_loadtxt.py (or iris_parse.ipynb and iris_loadtxt.ipynb if you use a Notebook), plotting_pi_mc.py , pi_mc_10.png, pi_mc_100.png, pi_mc_1000.png, pi_mc_10000.png, pi_mc_all4.png, gaussian.py, and PlotGaussian.png to GitHub.

...