Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions: Work on these problems using the R software environment. Submit your work as an R script (make sure it has the .R extension), and

image text in transcribed

Instructions: Work on these problems using the R software environment. Submit your work as an R script (make sure it has the .R extension), and add comments to show your reasoning or include your answers. Use my script for Session 8 as a reference. Problem 1: Create 3 functions in R called mean.binom, var.binom and sd.binom that compute the mean, variance and standard deviation of binomial rv's respectively. Include default values (of your own choice for the parameters for each function. Use these functions to compute the mean, variance and standard deviation of X ~ Bin(20,0.3) and Y ~ Bin(60, 0.02). Problem 2: In the same plot, graph three different hypergeometric distributions as follows: Plot 1 is the PMF of a hypergeometric random variable with N = 60, M = 15, n = 10. Plot 1 should be in blue (any shade of blue is fine). Plot 2 is the PMF of a hypergeometric random variable with N = 60, M = 30, n = 10. Plot 2 should be in green (any shade of green is fine). Plot 3 is the PMF of a hypergeometric random variable with N = 60, M = 45, n = 10. Plot 3 should be in red (any shade of red is fine). Make sure the graphs have different line types, and include a legend in the plot that identifies each graph. Include a title in your plot, and label the x and y axes. What patterns/similarities/relations do you observe in the graphs? Instructions: Work on these problems using the R software environment. Submit your work as an R script (make sure it has the .R extension), and add comments to show your reasoning or include your answers. Use my script for Session 8 as a reference. Problem 1: Create 3 functions in R called mean.binom, var.binom and sd.binom that compute the mean, variance and standard deviation of binomial rv's respectively. Include default values (of your own choice for the parameters for each function. Use these functions to compute the mean, variance and standard deviation of X ~ Bin(20,0.3) and Y ~ Bin(60, 0.02). Problem 2: In the same plot, graph three different hypergeometric distributions as follows: Plot 1 is the PMF of a hypergeometric random variable with N = 60, M = 15, n = 10. Plot 1 should be in blue (any shade of blue is fine). Plot 2 is the PMF of a hypergeometric random variable with N = 60, M = 30, n = 10. Plot 2 should be in green (any shade of green is fine). Plot 3 is the PMF of a hypergeometric random variable with N = 60, M = 45, n = 10. Plot 3 should be in red (any shade of red is fine). Make sure the graphs have different line types, and include a legend in the plot that identifies each graph. Include a title in your plot, and label the x and y axes. What patterns/similarities/relations do you observe in the graphs

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions

Question

=+ a. How does this change affect the incentives for working?

Answered: 1 week ago