As in HW0, the basic problem here is to determine, given an input sequence of real values, which distribution it follows. More specifically, for this assignment you are to develop a program that reads in a numeric table, and – for each dataset (i.e., each column in the table) – determines the distribution and parameters that gives the closest match to it.
There are two differences between HW1 and HW0:
- in HW1, the input data are always drawn from the Gamma distribution.
- in HW1, you must implement the Likelihood optimization yourself; you cannot use fitdistr().
As in HW0, your program could be given an input table like this:
The columns of this table define six datasets. Your program should produce a CSV file HW1_output.csv giving distributions that (it thinks) best fit the data. A correct output file could then look like this:
gamma,3,1 gamma,3,2 gamma,3,3 gamma,3,4 gamma,3,5 gamma,3,6
For simplicity, the parameters used in this assignment will always be integers, so the printed output should always have integer parameter values.
Your program can determine the distribution that fits best in any way you like. However, the notebook sketches a way to do this, and gives orientation about how to solve this problem in R.
In other words: yes, this is another simple assignment. It is intended as a warmup.
After running your program on the test input file HW1_test.csv, to complete this assignment please upload two files to CCLE:
- your output CSV file csv
- your notebook file ipynb
The notebook should have the commands you used to produce the output file. All assignment grading in this course will be automated, so please assume that when uploading files.