Question: 4. [15 marks] Consider the following density function f(r; k, A) = . KAK I( k+1) for = > >, (4) with shape parameter k

 4. [15 marks] Consider the following density function f(r; k, A)
= . KAK I( k+1) for = > >, (4) with shape

4. [15 marks] Consider the following density function f(r; k, A) = . KAK I( k+1) for = > >, (4) with shape parameter k > 2 and scale parameter > > 0. a) Give an explicit formula for the cumulative distribution function F(.) of a random variable X having density function f(r; k, A). b) Give an explicit formula for the inverse function F-1(.). c) Suppose you can only generate observations from a uniform random variable U on [0, 1] (using the R function runif ()). What is the name of the method seen in the lectures that enables you to simulate an observation x according to the distribution F from an observation u of U. d) Write an R function simf () that can generate randomly n i.i.d. observations from f(x; k, >). This function should have three arguments: n (for the sample size n), k and lambda. The last argument should be optional and have 1 as a default value. Your function should first check that input values for the arguments are correct, or return an error message. e) Write an R function denf () that can be used to evaluate the density in (4) at all values of an R vector x. This function should have three arguments: x, k and lambda. The last argument should be optional and have 1 as a default value. How would you use R to check that the function written in Part (d) works properly? Give an R code for that. f) Suggest an algorithm to approximate E ex] using Monte Carlo integration. You do not need to write the R code but make sure you derive the expressions that you need to use to execute the algorithm

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Mathematics Questions!