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

STAT 415 Final Exam

1.  (10pts) Let xi  ∼ Weibull(shape = 2, scale = b), with each xi  independent of all others.  Note that the shape parameter is KNOWN, and fixed at 2. Then

and E(x) = 0.886 ∗ b and Var(x) = 0.0129 ∗ b2 .

If you observe 40 data points as follows, use the data to provide a 95% confidence interval for the estimate of the variance v = 0.0129 ∗ b2 .  You may use any valid method to compute this confidence interval.

x=c(1.81,1.89,  6.07,  3.49,  2.19,  5.70,  1.82,  3.06,  2.99,  1.40,  5.01,  2.36,  3.58,  2.24,  3.97,

4.69,  2.16,  4.13,  4.08,  2.49,  3.55,  0.54,  4.57,  5.42,  5.54,  1.98,  1.48,  3.38,  3.08,  2.65, 0.65,  1.07,  2.89,  3.35,  5.76,  3.09,  3.51,  4.40,  1.85,  4.80)

Your answer to this question should be done on ”Q1-abc123.r” .  Please change the ”abc123” on the file name to your PSU identifier.

2.  (10pts) Hypothesis Testing. The following code will read in a data set with three variables:  ”isj” is the presence (isj=1) or absence (isj=0) of a bird species, the island scrub jay, at a location. ”elev” is the elevation of the location, and ”chap” is the percent of the landcover at that location that is composed of chapparal” .

load("bird.Rdata")

attach(bird)

summary(bird)

You will fit a logistic regression model to this data, with the model as follows:

Construct a Wald test to test the null hypothesis that H0  : b1  = 0 versus the alternative that HA  : b1 ≠ 0. Report the p-value of the test, and clearly state the conclusion of the test. Your answer to this question should be done on ”Q2-abc123.r”. Please change the ”abc123” on the file name to your PSU identifier.

3.  (10pts) Bayesian Inference. Use the following R code to read in a set of data.

v=c(0.22,   5.40,   0.48,    5.36,   9.93,    1.79,   3.54,    4.29,   5.62,   2.15,    3.31,   4.67,    2.56,

4.51,   5.88,    1.43,   2.60,  10.60,    5.76,    2.51,    0.54,   4.43,    1.21,   3.90,    6.37,   3.05, 3.19,    3.25,    6.45,    1.13)

Assume that vi  ∼ Gamma(a,b) (a Gamma distribution with shape=a and scale=b).  Additionally, assume that your prior for the shape parameter  a is  a  Exp(1)  and that your prior for the scale parameter b is b Gamma(shape = 2, scale = 3).

Use MCMC to obtain samples from your posterior distribution.  If you can, run your MCMC long enough that you have an effective sample size of at least 500.  Report the posterior mean of a, and a 95% credible interval on a.

Turn in your answer on “Q3-abc123.r”, but change the “abc123” to your PSU identifier.