Homework 4

Due 2020-09-30 by midnight.

Note that most problems have a ".ext" file extensions for the deliverable. This implies that you can use R or Python to solve the problem. For this assignment each problem that you submit code for, 3 points will be awarded for completing the project entirely on the server. This will give you practice dealing with coding and testing in that environment. For each of the problems, add a comment at the top stating if it was done entirely on the server or if Rstudio or any other IDE was used. There is no plotting or pdf's involved, so that should make it easier.
  1. Study Chapters 16-18 of Shotts.
  2. Study Chapters 9, 11, & 21 of Jones, Maillardet, & Robinson.
  3. Write a script that solves the mystery of the Polya urn: Polya.pdf. The Polya urn is actually a concept popular for some Bayesian non-parametric models. I had some fun making an epic scenario for this though.
  4. Using the hit-and-miss method, find the area defined by the region {(x,y): x^2 + y^2 ≤ 0.5, x^2 ≤ y ≤ x }. As always, assess your Monte Carlo error. Submit your solution in a file named "area.ext"
  5. Using Monte Carlo integration, find the integral of the function f(x) = 1-2/pi*(1-x)^2*exp(x)/x*asin(sqrt(x)) for x in [0,1]. Be more creative that simply sampling from the uniform distribution. As always, assess your Monte Carlo error. Submit your solution in a file named "integral.ext"
  6. A mark-recapture design is a common method used in ecology to determine the size of a population when it is impractical to count every individual of a population. The idea is to mark a certain number of species and then release them. Later you will again observe a certain number and count how many are marked. Suppose a pond has an unknown number of fish where each fish has an equal chance of being caught. You capture, mark, and release 100 of the fish. You then recapture 100 fish and observe 16 are marked. Use a simulation study to test the null hypothesis that there are 1000 fish in the pond against the alternative that there is not 1000 fish in the pond. Submit your work in a file called fish.ext
  7. Submit this homework by committing the necessary files (including any data files) in the appropriate directory and pushing to your central Git repository. Remember to not commit files that are easily reproducible.