Search the whole station

# 统计计算方法代写 R语言代写 统计作业代写 Bayesian代写

619

## HW 10

### Question (7 pts)统计计算方法代写

Recall the Beta distribution, which is defined for θ (0, 1) with parameters α and β, has a density proportional to:

θα1 (1 θ)β1

The Dirichlet distribution generalizes the the Beta distribution for k such θi values such that P ki=1 θk = 1.

Suppose that X1 counts the number observations of type 1, X2 counts the numbers of observations of type 2, and X3 counts the number of observations of type 3 in a sample (e.g., red, blue, and green cars observed on the highway). We will treat n = X1 + X2 + X3 as fixed, so that our data have a multinomial distribution, which generalizes the binomial distribution. As with the binomial distribution, we can notice that X3 = n X1 X2, and so is redundant.

The probability mass function for a multinomial distribution is proportional to

#### Part (a) (2 pts)

Consider the Bayesian model:

(θ1, θ2) Dirichlet(δ1, δ2, δ3)

(X1, X2) Multinomial(n, θ1, θ2)

Show that the posterior distribution π(θ1, θ2 | x1, x2) has a Dirichlet distribution with parameters (x1 + δ1, x2 + δ2, n x1 x2 + δ3). (Hint: find something that is proportional to the posterior distribution and argue that the only possible normalizing constant must lead to a Dirichlet distribution with the given parameters.)

Proof:

The posterior distribution of π(θ1, θ2 | x1, x2) can be expressed by:

Therefore the conditional distribution is still a Dirichlet distribution for θ1, θ2 and the parameter is (x1 + δ1, x2 + δ2, n x1 x2 + δ3)

#### Part (b) (2 pts)

Find the full conditional posteriors (up to a normalizing constant) for θ1 and θ2. Argue that

θ1 | θ2, x1, x2 (1 θ2) Beta(x1 + δ1, n x1 x2 + δ3)

and

θ2 | θ1, x1, x2 (1 θ1) Beta(x2 + δ2, n x1 x2 + δ3)

Hints:

• If X = aY , a > 0, and Y has density f(y), then X has density f(x/a)/a

• As we saw in class, be ruthless in dropping terms that don’t pertain to the main parameter as long as you can maintain proportionality. E.g.

So we can see that this is a scaled Beta distribution:

θ1 | θ2, x1, x2 (1 θ2) Beta(x1 + δ1, n x1 x2 + δ3)

Similarly for θ2, we have:

θ2 | θ1, x1, x2 (1 θ1) Beta(x2 + δ2, n x1 x2 + δ3)

#### ### Part (c) (3 pts)

A recent poll by Morning Consult/Politico asked voters their opinion on whether the Unite States Congress should raise the federal minimum wage.

```x_1 <- 806 # Congress should raise to \$15/hr
x_2 <- 435 # Congress should not raise the minium wage
x_3 <- 586 # Congress should raise to \$11/hr
n <- x_1 + x_2 + x_3```

(I have excluded the 8% of the sample with no opinion) 统计计算方法代写

Modeling these results as multinomial, we will investigate the proportions of registered voters holding opinions about the federal minimum wage.

Use the result from part (b) to implement a Gibbs sampler for (θ1, θ2 θ3| x1, x2). Let δ1 = δ2 = δ3 = 1.

Create a chain of length 5000. Using the last 2000 iterations from the chain give estimates of θ1, θ2 and θ3. Also provide 95% credible intervals for each of the parameters (quantiles of the posterior marginal distributions).

Estimate the probability that the \$15/hour wage is twice as popular no increase at all (i.e., P(θ12 > 2)).

### Question 2 (3 pt)统计计算方法代写

Read the paper “Less than 2 degree C warming by 2100 unlikely.” Briefly summarize the results (question, data, analysis). Carefully, read the section “Methods: Model Estimation”. Explain how they used their posterior distribution to generate the predictions they used in the paper.

The prev:

### Related recommendations

• #### 计量经济作业代写 ECON7310代写 R语言代写 计量经济代写

401

ECON7310: Elements of Econometrics 计量经济作业代写 Instruction Answer all questions following a similar format of the answers to your tutorial questions. When you use R to conduct empirical ...

View details
• #### r语言代写-r语言考试和作业难度大吗？不会可以找r语言代写

475

r语言考试和作业难度大吗？不会可以找r语言代写公司帮做吗？ r语言代写 在国外留学生可以获得更好的教学条件和资源，并且掌握世界一线知识和技巧，特别是互联网行业。现在很多国外大学都纷纷开设相关专业供留...

View details
• #### 统计分析作业代写 R语言作业代写 统计作业代写 R作业代写

109

Vaccination and severe COVID in Israel 统计分析作业代写 Background mRNA vaccines from Pfizer-BioNTech and Moderna received authorization for emergency use in the U.S. after being found to be ...

View details
• #### 数据统计作业代写 STAT 6227代写 r语言代写 SAS代写

253

STAT 6227, Assignment #1 数据统计作业代写 1. Distribution functions and hazard functions: Let T ∈ T be a time-to-event random variable within the time range T on (0, ∞) with probability 1. ...

View details
1