Statistic and Probability

Submitted by: Submitted by

Views: 18

Words: 895

Pages: 4

Category: Other Topics

Date Submitted: 03/29/2015 11:54 PM

Report This Essay

STAT/MATH – 380 LAB 3(CH 6, 8)– Assignment

All parts (that is a through k) in both problems 1 and 2 will be graded.

1. We have discussed several continuous probability distributions in chapter 6 and sampling distributions of sample mean in chapter 8. R has specific functions to generate data randomly from specific probability distributions for given parameter values. Also R has several functions that allow us to easily draw samples from named probability distributions (sampling from non-named probability distributions is possible with more programming).

Suppose variable X ~ Gamma(α=4, β=2).

a) Provide another name for this probability distribution with parameter value/s.

Chi squared distribution V = 8

b) What are the population mean and variance for Gamma(4, 2)?

Mean = V=8

Variance = 2V=16

The code shown below generates the population distribution of X which is distributed Gamma(4, 2). The seq() function generates a sequence which will be used as the possible values for random variable X although X takes infinitely many positive values. The dgamma() function provides the probability density function for given values of X and parameter values.

x.seq<-seq(from = 0, to = 20, by = 0.5)#support of X (technically goes to infinity)#

alpha<-4 # Sets alpha parameter#

beta<-2 # Sets beta parameter#

y<-dgamma(x = x.seq, shape = alpha, scale = beta) #Generates the Gamma pdf with alpha and beta#

plot(y, type='l', xlab="X", main= "Distribution of Gamma(4, 2)")

Run the above code in Rstudio, and then copy and paste plot here.

c) Based on the above plot, comment about the shape of the Gamma(4, 2) distribution?

The peak of the graph is between the value of 10 and 20. The graph is not a bell shape, and it is not a symmetric shape.

Let’s draw k number of random samples of size n from a Gamma(4, 2). We can use the function called rgamma() to randomly generate values from the gamma distribution.

d) Run the following code in...