Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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 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

Step: 1

Answer J... 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

Step: 3

blur-text-image

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

Advanced Financial Accounting

Authors: Thomas Beechy, Umashanker Trivedi, Kenneth MacAulay

6th edition

013703038X, 978-0137030385

More Books

Students also viewed these Accounting questions

Question

Where do you see yourself in the future?

Answered: 1 week ago

Question

1. What type of outfits are you expected to wear at work?

Answered: 1 week ago