Question: 2. Programming fun with F (Total 17 points) For this question, we require some programming, you should only use Python. You may use the scripts

2. Programming fun with F (Total 17 points) For this question, we require some programming, you should only use Python. You may use the scripts provided on the class website as templates. Do not use any libraries or functions to bypass the programming effort. Please submit your code in the google form (will be announced) with sufficient documentation so the code can be evaluated. Attach each plot as a separate sheet to your submission. All plots must be neat, legible (large fonts), with appropriate legends, axis labels, titles, etc. (a) Write a program to plot F (empirical CDF or eCDF) given a list of samples as input. Your plot must have y-limits from 0 to 1, and x-limits from 0 to the largest sample. Show the input points as crosses on the x-axis. (3 points) (b) Use an integer random number generator with range [1, 99] to draw n=10, 100, and 1000 samples. Feed these as input to (a) to generate three plots. What do you observe? (2 points) (c) Modify (a) above so that it takes as input a collection of list of samples; that is, a 2-D array of sorts where each row is a list of samples (as in (a)). The program should now compute the average F across the rows and plot it. That is, first compute the F for each row (student), then average them all out across rows, and plot the average F. Show all input points as crosses on the x-axis. (3 points) (d) Use the same integer random number generator from (b) to draw n=10 samples for m=10, 100, 1000 rows. Feed these as input to (d) to generate three plots. What do you observe? (2 points) (e) Modify the program from (a) to now also add 95% Normal-based Cl lines for F, given a list of samples as input. Draw a plot showing and the Ci lines for the q2.dat data file (799 samples) on the class website. Use x-limits of 0 to 2, and y-limits of 0 to 1. (3 points) (f) Modify the program from (e) to also add 95% DKW-based Cl lines for f.Draw a single plot showing f and both sets of CI lines (Normal and DKW) for the g2.dat data. Which Cl is tighter? (4 points) 2. Programming fun with F (Total 17 points) For this question, we require some programming, you should only use Python. You may use the scripts provided on the class website as templates. Do not use any libraries or functions to bypass the programming effort. Please submit your code in the google form (will be announced) with sufficient documentation so the code can be evaluated. Attach each plot as a separate sheet to your submission. All plots must be neat, legible (large fonts), with appropriate legends, axis labels, titles, etc. (a) Write a program to plot F (empirical CDF or eCDF) given a list of samples as input. Your plot must have y-limits from 0 to 1, and x-limits from 0 to the largest sample. Show the input points as crosses on the x-axis. (3 points) (b) Use an integer random number generator with range [1, 99] to draw n=10, 100, and 1000 samples. Feed these as input to (a) to generate three plots. What do you observe? (2 points) (c) Modify (a) above so that it takes as input a collection of list of samples; that is, a 2-D array of sorts where each row is a list of samples (as in (a)). The program should now compute the average F across the rows and plot it. That is, first compute the F for each row (student), then average them all out across rows, and plot the average F. Show all input points as crosses on the x-axis. (3 points) (d) Use the same integer random number generator from (b) to draw n=10 samples for m=10, 100, 1000 rows. Feed these as input to (d) to generate three plots. What do you observe? (2 points) (e) Modify the program from (a) to now also add 95% Normal-based Cl lines for F, given a list of samples as input. Draw a plot showing and the Ci lines for the q2.dat data file (799 samples) on the class website. Use x-limits of 0 to 2, and y-limits of 0 to 1. (3 points) (f) Modify the program from (e) to also add 95% DKW-based Cl lines for f.Draw a single plot showing f and both sets of CI lines (Normal and DKW) for the g2.dat data. Which Cl is tighter? (4 points)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
