Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit


STA 238 - Assignment #1

 

This is an individual assignment - all work and ideas presented should be entirely your own.  The purpose is to assess your acquisition of course concepts and ability to apply them to problems done by hand, and to demonstrate these concepts through simulation methods.

Complete the written portions of the assignment on the PDF file in the space provided.  If you cannot access a printer, then you may complete the work on a separate paper and follow all upload instructions on Crowdmark.  Questions about the assignment should be addressed via course email and not the discussion boards to avoid cluttering the space. The teaching team will be looking for:

● Use of notation at course level, including variable definitions and complete distribution spec- ifications as modeled in class

● Justifications using definitions, laws, axioms for your calculations (e.x. E(XY) = E(X) . E(Y) if X and Y are independent).  We are looking for evidence that you are able to connect and apply course concepts, with the final numerical result being worth at most 1 point.

● Crucial steps shown in your work (e.g.  we don’t need to see all the integration steps, but it should be clear why you are integrating, and the corresponding result). Any reader should be able to easily follow your process through your work.

● Formatting and organized presentation of work. Round all final answers to four decimal places (two for answers expressed in %)

● Written statements should be made in complete sentences using appropriate course level terminology.

For problems that use R (Labeled Problem * [R - * points]):

● All R work must be done in an R Markdown file, using the tools and methods covered in our course. File should knit to pdf, with question headers, each question on a new page (\newpage in your rmd text)

● Set seed before every random sampling you run.

● Your knit document should include:  executable code chunks, required output values, and written responses using correct LaTeX notation.

● All graphs should include clear titles and axis labels that makes clear what data is being plotted

● DO NOT: print outs of full vector/data frame of large simulations or data sets.  Save to an object and use glimpse() or head() to show the data for reference.


Problem  1 [9 points]. This question should be completed by hand. This means without the use of R to run large summations for you!

When collecting data through a voluntary survey, people are selected at random and asked to volunteer their time to answer some questions.  It’s not surprising that the percentage of people who agree to participate in a survey is often low, about 5% or 1 in every 20 people.

a)  (3 points) If you ask 50 people to participate in your survey, what is the probability that no more than 6 people will agree?

 

 

 b)  (2 points) What is the minimum people you would have to ask to participate in your survey before you can use an approximating distribution to compute probabilities?  What are the consequences of using the approximating distribution if you have not reached this minimum?

 

 

c)  (4 points) You recruit a few other people to help you search for participants and in total, you are able to ask a total 300 people in any given day to participate in your survey. What range of typical response rates (in percentages) can you expect to see 97% of the time 300 people are asked to participate?

 


Problem  2A [9 points]. You collected a random sample of 8 observations that you believe orig- inate from a distribution with the following probability density function:

f (ylα, β) = 

where parameters α > 1 and β > 0. Your data set is as follows:

2.21   2.19   2.37   2.29

4.70   2.14   3.89   2.33

a)  (1 point) Suppose you perform empirical bootstrap on this data. How many bootstrap resam- ples are possible?

 

 

b)  (6 points) Suppose you know that β = 2.  Find the method of moment estimator for α and compute the point estimate from the data. Your work should show clearly how you arrive at the final expression for your estimator. Do you think MoM  is unbiased? You do not need a formal derivation, but you should provide concrete arguments for why it is/is not unbiased.

 

 

c)  (2 points) In this situation, which of empirical bootstrap or parametric bootstrap would be the better method in studying the behaviour of MoM ? Why?

 



Problem  2B [R - 15 points]. You collected a random sample of 8 observations that you believe originate from a distribution with the following probability density function:

f (ylα, β) = 

where parameters α > 1 and β > 0. Your data set is as follows:

2.21   2.19   2.37   2.29

4.70   2.14   3.89   2.33

Assuming β = 2, and continuing from your work in problem 2A:

a)  (4 points) Using 1000 bootstrap resamples, implement the centred empirical bootstrap on this data set, and store your bootstrapped centred values in a vector. Use glimpse() function to glimpse your bootstrapped values.

b)  (4 points) Repeat (a) by implementing the centred parametric bootstrap on this data instead, again assuming β = 2. Hint:  You may find it helpful to know that F (y) = 1 - / a .

c)  (4 points) Plot the density histogram of the bootstrapped centred values of  for each boot- strapping method, adjusting the scale of your grid so both density histograms are plotted on the same interval.  Use grid.arrange to plot both graphs in a 2x1 column.  Overall, do you think parametric and empirical bootstrap perform fairly similarly in recreating estimator behaviour? What notable differences, if any, do you see between the two methods?

d)  (3 points) If you had half the size of your data set, which bootstrap method do you think would perform better? Why?



Problem  3 [R - 17 points]. You have learned in probability that the sampling distribution of n  is not normally distributed when Xi   y N (µ, σ2 ).  However, Central Limit Theorem tells us that the distribution should converge to a normal distribution in the limit as n, the sample size, grows to infinity. In this problem, you will investigate this visually, and by comparing probabilities calculated from CLT and from simulation.  Parts (a)- (b) require plotting, but all other parts can be completed independently without these graphs.

The Weibull distribution is defined by two parameters:  shape (α > 0) and scale (β > 0) and has the following density function:

f (xlα, β) =  /   a − 1 e − (z/8)α , x > 0

Weibull distributed random variables have the following expected value and variance:

E(X) = β . Γ(1 + 1/α)          V (X) = β2  . (Γ(1 + 2/α) - (Γ(1 + 1/α))2 )

Γ(y) is the Gamma function, and can be tricky to compute if y is not a positive integer.  Instead, you can calculate the values using R using the gamma(y) function. See ?gamma for usage information.



a)  (2 points) Plot a graph in R of the density function of Weibull(α = 0.45, β = 4), compute the mean of this distribution (provided above) in R and plot it as a vertical line in your graph. Briefly describe the shape, skew (if any) of the distribution, and explain whether you think that the result of CLT will apply with a sample size of 15.

b)  (6 points) Using a simulation size of 1000 and your student number as the seed, for each sample size starting at n = 10 and increasing to n = 130 in increments of 30, produce and save the corresponding density histogram representing the sampling distribution of n . Based on visual inspection, state which sample size you think is sufficiently large for Central Limit Theorem to offer good approximations.

Your plots should include in their titles: the parameters of the Weibull distribution, the sample size, and the simulation size. Display all plots in a grid using grid.arrange.

c) This step is to help you note the necessary components in CLT but is allotted any points. Compute the exact expected value and variance of n   for each sample size you have in (b).  Then, create a tibble that displays for each sample size the following row information: n, E(n ), V (n ). Print the tibble. For example:


n

E(n )

V (n )

20

0.5

0.25

40

0.5

0.0625

 

d)  (3 points) Let’s examine the consequences when we use Central Limit Theorem without veri- fying that a normal approximation is reasonable!

Using n = 10, state the normal distribution you would use according to Central Limit Theo- rem. Use this to estimate the probability the sample mean is between 15 and 25. Estimate this probability again using the simulated pool of sample means for n = 10. How does the normal approximation compare with the simulated probability? Be detailed in your comparison (e.g. Are they similar? Different? How different?)

e)  (2 points) Repeat (d) for sample size n = 130. How does the normal approximation compare with the simulated probability now?

f)  (4 point) Which of the two computed probabilities (normal approximation versus simulation) is more accurate to the true probability?   Briefly explain why it is more accurate.   How can the normally approximated probability be made more accurate? How can the simulated probability be more accurate?

BONUS  (2 points) Upload  separately  in  Crowdmark.   Reproduce your graph from  (b) using

grid.arrange, this time with each histogram overlaid with the normal density curve you would use when applying CLT for those sample sizes.  With the overlay, can you better determine which sample size results in a sample mean that has an approximately normal distribution?