Just to continue working with R, I would like you to complete four very simple tasks....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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) 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)
Expert Answer:
Related Book For
Advanced Financial Accounting
ISBN: 978-0137030385
6th edition
Authors: Thomas Beechy, Umashanker Trivedi, Kenneth MacAulay
Posted Date:
Students also viewed these accounting questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Aardvark Delivery Service (ADS)' was formed 30 years ago with a mandate to establish a private delivery system in the country of Aardvark. By 20X5, ADS was handling close to 30 million pieces of mail...
-
Managing Scope Changes Case Study Scope changes on a project can occur regardless of how well the project is planned or executed. Scope changes can be the result of something that was omitted during...
-
The City of Amarillo is authorized to issue $8,000,000, 3 percent regular serial bonds in 2017 for the construction of a new exit off the interstate highway within city limits. The bonds mature in...
-
Suppose a Costco store in Denver, Colorado, ended September 2014 with 100,000 units of merchandise that cost an average of $7.20 each. Suppose the store then sold 95,000 units for $1,235,000 during...
-
____________ leadership model suggests that leadership style is strongly anchored in personality and therefore hard to change. (a) Trait (b) Fiedlers (c) Transformational (d) Path-goal
-
Consider a simple bivariate VECM \[ \begin{aligned} & y_{1 t}-y_{1 t-1}=\delta_{1}+\alpha_{1}\left(y_{2 t-1}-\beta y_{1 t-1}-\mu ight) \\ & y_{2 t}-y_{2 t-1}=\delta_{2}+\alpha_{2}\left(y_{2...
-
The three-station work cell illustrated in figure S7.7, has a product that must go through one of the two machines at station 1 (they are parallel) before proceeding to station 2. (a) What is the...
-
Surveillance could be an important aspect of an internal investigation. What are some special techniques used in surveillance? What are the legal and privacy issues that might be involved? Do you...
-
Buckeye Manufacturing produces heads for engines used in the manufacture of trucks. The production line is highly complex, and it measures 900 feet in length. Two types of engine heads are produced...
-
a) What type of order would an investor make if he owns some stocks and wants to ensure their sale on April 15 th ? Explain your answer. b) What type of order would an investor engage in if he took a...
-
Calculate what is the maximum viewing distance for a given setup to be able to distinguish all details: - diagonal of the display 2.1 m, - display ratio 4:3, - display resolution: 4K UHDTV. Write...
-
Several health care advocacy groups are pushing to mandate higher staffing levels in assisted living facilities. What would be the impact on the labor market for care givers in assisted living...
-
Discuss the first, second, third, fourth, and fifth concepts, strategies, or lessons learned that you found most valuable in the course. Remember, explain in detail why you found it significant and...
-
A paragraph with the following topical sentence: "Aquinas's discussion of commercial fraud is concerned with sin not efficiency." St. Thomas Aquinas, "On Fraud Committed in Buying and Selling,"...
-
Lauren loves reading both e-books (E) and paper-books (P). Her utility function is given by: U(E, P) = E + P Assume that Lauren has $30 to spend on both types of books and that the price of e-books,...
-
I already have the code for the two assignments below but there are some errors in the code, please help me fix them The assignments: E7.16/ Add a method to the Table class below that computes the...
-
As water moves through the hydrologic cycle, water quality changes are common because of natural phenomena or anthropogenic pollution. Using Figure 11.1, describe how water-quality changes occur...
-
Pond Ltd. and Stream Inc. have reached agreement in principle to combine their operations. However, the boards of directors are undecided as to the best way to accomplish the combination. Several...
-
What is a government transfer? Describe the two kinds of transfer terms a government may impose on a transfer.
-
Pop Company acquired 70% of Son Limited on January 1, 20X4, for $ 345,000. On the acquisition date, common shares and retained earnings of Son Limited were $ 100,000 and $ 200,000 respectively. The...
-
Thermos flask is an example of ................ system.
-
In a ................, mass, momentum and energy may flow.
-
The thermodynamic properties which depend on the mass of the system are called ................ properties.
Study smarter with the SolutionInn App