Question: Just to continue working with R, I would like you to complete four very simple tasks. The first three are using expectation and the

Just to continue working with R, I would like you to complete 

Just to continue working with R, I would like you to complete four very simple tasks. The first three are using expectation and the random number generation in R for the binomial, hypergeometric, and exponential distributions. The third task is to plot multiple densities on a graph to see how the parameter changes the density form for the exponential. 1) Using the function rbinom in R, generate 1000 random deviates from a B(20,.4) distribution, compute the sample mean and compare with the theoretical expectation. 2) Using the function rhyper in R, generate 1000 random deviates from a hypergeometric distribution with 4 white balls, 8 black balls, and 3 balls drawn without replacement. Compute the sample mean and compare with the theoretical expectation. 3) Using the function rexp in R, generate 1000 random deviates from an exponential with lambda=3. Compute the sample mean and compare with the theoretical expectation, which is 1/lambda. 4) Using the curve function in R, generate different exponential densities: > curve(4*exp(-4*x),.01,10) > curve (2*exp(-2*x),.01,10,col="red",add=T) > curve (1*exp(-1*x),.01,10,col="blue",add=T) > curve (0.5*exp(-.5*x),.01,10,col="green",add=T)

Step by Step Solution

3.43 Rating (159 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Answer J... View full answer

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 Accounting Questions!