STA312 H5S 计算机统计

University of Toronto Mississauga
STA312 H5S: Computational Statistics - Winter 2020
Final Project.
Instructions:
❼ Solve only ONE question.
❼ You can solve this project either individually or by a group of two. The solution that comes from a
group is expected to have a higher quality of work.
❼ There are some questions in the project that require your input. For
example, choosing the importance function, the set-up of control variate
or target density, etc. I don’t have answers for such questions. Do your
best to answer with quality, justify your work and with details.
❼ In this project, you should use R only when it is required. Any other software will
not be accepted.
❼ Start your R codes with the following information: Course Number, Final Project,
Question #, Your Last Name, First Name, Student Number. For Example,

Course: STA312

Final Project: # 1

Last Name: ABCD, First Name: XYZW

St. #: 0123456789

❼ You may not alter the output (by typing or handwriting anything). Output should
be directly copied and pasted to the project where needed. If you do not follow these
rules, your assignment will not be accepted.
❼ Your project should be presented neatly. Use the following format:
– Theoretical questions can be hand-written or typed. Though, I recommend
typed!
– Attach the cover page (provided) at the front of your project. (Be sure to fill
in/circle all the information required).
– Include the question numbers/part letters (1a,b,c, etc.) in your answers.
– Do not simply hand in pages of R output without further explanation. Only
include the relevant tables or plots that are asked in each question. Make sure
to interpret the results in plain English in terms of the problem, quote relevant
numbers from the output, and give justifications as a part of your solutions.
– Do not include unnecessary code or output in the body of the project. At the
end, include an appendix with ALL your R code and output.
STA312- Instructor: Dr. Luai Al Labadi Page 1 of 5
Only general discussion is permitted between students. You
must hand in solutions in your own words. Do not let others
see your solutions or your selected article. It is plagiarism (a
serious academic offence) to submit solutions in other people’s
words (including but not limited to other students, the instructor’s,
solutions from previous years or courses, websites, etc).
You are responsible for knowing and adhering to the University
of Toronto’s Code of Behaviour on Academic Matters (see course
outline).
STA312- Instructor: Dr. Luai Al Labadi Page 2 of 5
Answer any ONE of the following questions.

  1. Consider the following two probability density functions:
    f(x) = 2(x − c1)(c2 − c1)2
    for c1 < x < c2
    and
    g(x) = 2(c2 − x)(c2 − c1)2for c1 < y < c2,
    where c1 and c2 are finite real numbers.
    (a) Show that R c2.
    (b) Find the cumulative distribution functions F(x) and G(x).
    (c) Write an algorithm to generate a sample from f(x) using the Inverse-Transform algorithm.
    (d) Show that if X ∼ f(x), then 1 − X ∼ g(x). Explain how you can use this relationship to generate
    a sample from g.
    (e) Show that if X ∼ h(x) = 2x, for 0 < x < 1, then Y = c1 + (c2 − c1)X ∼ f.
    (f) Derive the inverse-transform algorithm for generating from a sample from h.
    (g) Explain how you extend the algorithm in (f) to generate a sample form f and a sample from g.
    (h) Show that if U1 and U2 are two independent random variable from Uniform[0, 1]. Show that Z =
    max(U1, U2) has the density h.
    (i) Use part (h) to propose an algorithm to sample from f and from g.
    (j) Using R, generate a sample of size 104
    from f (set c1 = 1, c2 = 5) using the two algorithms in (c) (or
    (g)) and (i). For the generated samples, plot the relative frequency histogram and the corresponding
    density on the same picture. Report the mean and the variance for each case.
    (k) Repeat part (j) by replacing f by g.
    (l) Propose an Acceptance-Rejection algorithm to generate a sample from f for c1 = 1, c2 = 5. Using R,
    compare this method with the previous two methods. Use an appropriate method for comparison.
    Which one you recommend and why?
    STA312- Instructor: Dr. Luai Al Labadi Page 3 of 5
    be the probability density function of a random variable X and k is a positive constant.
    (a) Find a Monte Carlo estimation to k. denote this estimator by ˆk. Hint: use importance sampling.
    Compare with the following densities on −∞ < x < ∞:
    You need to write the explicit formula of the estimator for each case.
    (b) Using R, for each of the above densities, provide the numerical value of the estimator.
    (c) Find a Monte Carlo estimation estimate for E[X] and E[X2
    ]. You may use ˆk based on f3. You
    need to write the explicit formula of the estimator. Use R to obtain the numerical values. Estimate
    the error in the estimation. Report 95% confidence intervals.
    (d) Use another variance reduction technique to estimate k. You need to write the explicit formula of
    the estimator. Using R, provide the numerical value of this estimator in (e). Compute the mean
    squared error of the estimator.
    (f) Use the Acceptance-Rejection algorithm to generate a sample from f. Plot the relative frequency
    histogram and the corresponding density on the same picture.
    (j) Find the exact value of k. Hint: Γ(z) = R ∞0xz−1e−xdx.
    (k) Plot the true density on the same picture in (f).
    STA312- Instructor: Dr. Luai Al Labadi Page 4 of 5
  2. Consider the data given in the file lifetime.txt.
    (a) Let X denote the lifetime. Estimate E(X) (provide a confidence interval).
    (b) Apply nonparametric bootstrap procedure to estimate med(X) and kurtosis(X). Estimate 95%-
    quantile. Provide appropriate confidence intervals.
    (c) Verify that data follow an exponential distribution. Find λb¸ , an estimator of λ.
    (d) Apply parametric bootstrap procedure to estimate med(X), kurtosis(X) and 95%-quantile.
    (e) Compare values obtained via bootstrap to the theoretical values (based on the estimated λb).
    Good Luck
    STA312- Instructor: Dr. Luai Al Labadi Page 5 of 5
    WX:codehelp

你可能感兴趣的:(后端)