[Solved] AMS 597 Homework 6

$25

File Name: AMS_597_Homework_6.zip
File Size: 169.56 KB

SKU: [Solved] AMS 597 Homework 6 Category: Tag:
5/5 - (1 vote)

AMS597

  1. Compute a Monte Carlo estimate of

Compare your estimate with the exact value of the integral.

  1. We will estimate of

using two different approaches:

  • Compute a Monte Carlo estimate () of by sampling from Uniform(0, 0.5), and estimate the variance of .
  • Compute a Monte Carlo estimate () of by sampling from the exponential distribution, and estimate the variance of .
  • Compare the two variances. Which one is smaller?
  1. Write a function to compute a Monte Carlo estimate of the Beta(a,b) cdf, F(x)
    • by sampling from Uniform(0,x) (name this function pbeta1)
    • by sampling from U Gamma(a,1) and V Gamma(b,1) and using the result that Y = U/(U + V ) Beta(a,b) (name this function pbeta2)
    • Use pbeta1 and my.pbeta2 to estimate F(x) of Beta(3,3) for x = 0.1,0.2,,0.9. Compare the estimates with the values returned by the pbeta function in R.
  2. (a) Generate X1,,X20 from N(0,1). Consider testing H0 : = 0 vs Ha : 6= 0. Compute the p-value from (1) one sample t-test and (2) exact wilcoxon signed rank test. Repeat this process 1000 times. Estimate the empirical Type I error for both tests at = 0. (Hint: Empirical Type I error is the proportion of wrongly rejected null hypothesis).

(b) Now generate X1,,X20 from N(0.5,1). Consider testing H0 : = 0 vs Ha : 6= 0. Compute the p-value from (1) one sample t-test and (2) exact wilcoxon signed rank test. Repeat this process 1000 times. Estimate the empirical power for both tests at = 0.05.

  1. (a) Generate X1,,Xn from N(0,1) and Y1,,Yn from N(0.5,1.5). Consider testing H0 : X Y = 0 vs Ha : X Y 6= 0. Compute the p-value from two sample t-test. Repeat this process 1000 times. Estimate the empirical power for this test at = 0.05 for n = 10,20,30,,100. Based on your plot, what is the minimum sample size to achieve power > 80%.

(b) Edit: You do not need to show how the formula is derived. An approximate sample size formula for comparing two population means using z-test for the hypothesis in (a) is

Compare your results in (a) to this sample size formula.

Shopping Cart
[Solved] AMS 597 Homework 6
$25