Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code in R 2. Suppose that Y|A has an exponential distribution with mean A, and A has an inverse gamma distribution with parameters a =

code in R image text in transcribed
2. Suppose that Y|A has an exponential distribution with mean A, and A has an inverse gamma distribution with parameters a = 3 and 6 = 10. We proved in class that the Y ~ Pareto(a = 3,0 = 10). Perform a Monte Carlo simulation to show that simulating from the continuous mix- ture structure is no different statistically than simulating from the Pareto distribution. i.e. simulate two samples of size 10000 each, once by using the continuous mixture structure and another time by using the Pareto distribution. Compare the two simu- lated samples by comparing their empirical cdf graphically. This will be done by following the below steps in R. (a) Install and load the package actuar. Use the functions install package and library. This package allows us to use actuarial related functions. In this assignment, we will use Pareto distribution related function that are available in actuar. (b) Define the needed paramaters. () Set a seed equal to your ID number. (d) Let lambda be a sample simulated from fa (e) Let Yi be a sample simulated from fria by using the values of lambda that are simulated in the previous step. (f) Let Y2 be a sample simulated from fy. (8) Compare the empirical cdf of Y1 and Y2 by plotting both empirical edfs on the same plot. Use different colors for each curve and include a legend that explains your graph. Choose the appropriate widths for the lines. (h) What do you conclude? 2. Suppose that Y|A has an exponential distribution with mean A, and A has an inverse gamma distribution with parameters a = 3 and 6 = 10. We proved in class that the Y ~ Pareto(a = 3,0 = 10). Perform a Monte Carlo simulation to show that simulating from the continuous mix- ture structure is no different statistically than simulating from the Pareto distribution. i.e. simulate two samples of size 10000 each, once by using the continuous mixture structure and another time by using the Pareto distribution. Compare the two simu- lated samples by comparing their empirical cdf graphically. This will be done by following the below steps in R. (a) Install and load the package actuar. Use the functions install package and library. This package allows us to use actuarial related functions. In this assignment, we will use Pareto distribution related function that are available in actuar. (b) Define the needed paramaters. () Set a seed equal to your ID number. (d) Let lambda be a sample simulated from fa (e) Let Yi be a sample simulated from fria by using the values of lambda that are simulated in the previous step. (f) Let Y2 be a sample simulated from fy. (8) Compare the empirical cdf of Y1 and Y2 by plotting both empirical edfs on the same plot. Use different colors for each curve and include a legend that explains your graph. Choose the appropriate widths for the lines. (h) What do you conclude

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data And Databases

Authors: Jeff Mapua

1st Edition

1978502257, 978-1978502253

More Books

Students also viewed these Databases questions