Ps 5
Ps 5
You may work in groups of up to three. Within groups, you may copy code.
Across groups, please do not copy code. You will submit your R code on Canvas.
I should be able to run your R code without changing anything (e.g. please do
not hardcode paths such as /Users/YourName/...) and without error. Note
that the readability and organization of your R file(s) is part of the grade.
This problem set is related to a well-known problem called the German Tank
Problem1 , but we will allow for the case where the the serial numbers of the
tanks might not start with 0.
1
7. What would you guess is E(X(1) )? (Do not solve this using brute-force
math. Use only intuition. You may check with math if you prefer, though.)
8. Find E(X(n) − X(1) ).
9. Propose an unbiased estimator for the range, b − a.
form distribution with unknown range [a, b] and returns a vector â, b̂ of
unbiased estimates. Please call this function est_unif_range or estUnifRange.
The rest of the questions discuss the specific case of a = 75, b = 200, n = 5. It is
often useful to (1) use simulations by setting the parameters a and b to numbers
to generate the data; (2) pretend that we don’t know what a and b are and try
to estimate them; and finally to (3) look and see how we did at estimating them
by comparing them to the true values (the ones used to generate the data).
12. Suppose that a = 75, b = 200, n = 5. Based on your answer in (8), what
is the bias of X(n) − X(1) in this particular case?
13. Provide R code to confirm that your answer in (11) produces results that
you expected. That is, using simulations show that the R function you
created does indeed produce unbiased results. (The purpose of this ques-
tion is that it’s always a good idea to check theory with simulations to
confirm your theoretical result and also to confirm that you did not make
a mistake in writing the R function.)
h i0
14. Using simulations, estimate the variance-covariance matrix of â, b̂ .