(5/5)

General instructions: Must be completed as a pdf file. Be sure to include your name in the file. Give the commands to answer each question in its own code block, which will also produce plots that will be automatically embedded in the output file. Each answer must be supported by written statements as well as any code used.

The project is worth 100 total points.

10 points for good-faith effort at every part.

10 points for clean, well-formatted, easily readable code. 80 points based on correctness of the questions below.

Part I - Rescaled Epanechnikov kernel

The rescaled Epanechnikov kernel is a symmetric density function given by f(x) = {}

(1-2) for r≤1

otherwise

1. (4 points) Check that the above formula is indeed a density function (using calculus).

(1)

2. (4 points) Produce a plot of this density function. Set the X-axis limits to be -2 and 2. Label your axes properly and give a title to your plot.

3. (6 points) Devroye and Gy'orfi give the following algorithm for simulation from this distribution. Generate iid random variables U1, U2, U3~ U(-1, 1). If Us U2 and Us 2 U1, deliver U2, otherwise deliver Us. Write a program that implements this algorithm in R. Using your program, generate 1000 values from this distribution. Display a histogram of these values.

4. (6 points) Construct kernel density estimates from your 1000 generated values using the Gaussian and Epanechnikov kernels. How do these compare to the true density?

Part II Metropolis Hastings

Suppose we have observed data 31, 32, 1/200 sampled independently and identically distributed from the mixture distribution

SN (7,0.52)+(1-6)N(10,0.52).

5. (5 points) Simulate 200 realizations from the mixture distribution above with = 0.7.

6. (2 points) Draw a histogram of the data that also includes the true density. How close is the histogram to the true density?

7. (5 points) Now assume & is unknown with a Uniform (0,1) prior distribution for 8. Implement an independence Metropolis Hastings sampler with a Uniform (0,1) proposal.

8. (5 points) Implement a random walk Metropolis Hastings sampler where the proposal ds = 8(t) + € with Uniform(-1,1).

9. (3 points) Explain why the independence Metropolis Hastings sampler from (7) is better than the random walk Metropolis Hastings sampler from (8).

(5/5)

CS 340 Milestone One Guidelines and Rubric Overview: For this assignment, you will implement the fundamental operations of create, read, update,

Retail Transaction Programming Project Project Requirements: Develop a program to emulate a purchase transaction at a retail store. This

7COM1028 Secure Systems Programming Referral Coursework: Secure

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

CS 340 Final Project Guidelines and Rubric Overview The final project will encompass developing a web service using a software stack and impleme