Question: Problem 4: (10 pts each) (a) Write an R function runifmax () that has three arguments, n, a, and b, and returns the maximum of

 Problem 4: (10 pts each) (a) Write an R function runifmax

Problem 4: (10 pts each) (a) Write an R function runifmax () that has three arguments, n, a, and b, and returns the maximum of a vector of n random numbers from the uniform distribution Unif(a, b). Make the arguments a and b optional with default values of 0 and 1, respectively. (b) Write an R code that replicates runifmax() hundred thousand times with input parameters n = 30, a = 0, and b = 2, and saves it to a vector v. Plot a histogram of vector v. (c) Write an R code that plots the empirical density of a vector v over a histogram obtained in part (b). (see Session 4 for empirical density function in R)

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!