/*! This file is auto-generated */ .wp-block-button__link{color:#fff;background-color:#32373c;border-radius:9999px;box-shadow:none;text-decoration:none;padding:calc(.667em + 2px) calc(1.333em + 2px);font-size:1.125em}.wp-block-file__button{background:#32373c;color:#fff;text-decoration:none} Q9SE In Example 12.5.6, we modeled th... [FREE SOLUTION] | 91Ó°ÊÓ

91Ó°ÊÓ

In Example 12.5.6, we modeled the parameters \({\tau _1}, \ldots {\tau _\pi }\) as i.i.d. having the gamma distribution with parameters \({\alpha _0}\) , and \({\beta _0}.\) We could have added a level to the hierarchical model that would allow the \({\tau _\iota }\) 's to come from a distribution with an unknown parameter. For example, suppose that we model the \({\tau _\iota }\) 's as conditionally independent, having the gamma distribution with parameters \({\alpha _0}\) and \(\beta \) given \(\beta \). Let \(\beta \) be independent of \(\psi \) and \({\mu _1}, \ldots ,{\mu _p}\) with \(\beta \) having the prior distributions as specified in Example 12.5.6.

a. Write the product of the likelihood and the prior as a function of the parameters \({\mu _1}, \ldots ,{\mu _p},{\tau _1}, \ldots ,{\tau _\pi },\psi ,\) \(\beta \).

b. Find the conditional distributions of each parameter given all of the others. Hint: For all the parameters besides \(\beta \), the distributions should be almost identical to those given in Example 12.5.6. It wherever \({\beta _0}.\) appears, of course, something will have to change.

c. Use a prior distribution in which and \({\psi _0} = 170.\) Fit the model to the hot dog calorie data from Example 11.6.2. Compute the posterior means of the four \({\mu _i}'s\) and

\(1/{\tau _i}^\prime s.\)

Short Answer

Expert verified

(a) The product of the two functions uses parameters given in the exercise and the distribution of\(\beta .\)

(b) The conditional distribution of\(\beta .\)given all other parameters is gamma distribution.

(c) The estimated posterior means of\({\mu _i},i = 1,2,3,4\)are respectively,\(156.8,158.4,120.3,\)and\(160.1.\)

The estimated posterior means for the \(1/{\tau _i},i = 1,2,3,4\) are, respectively, \(494.9,609.4,545.6,\) and \(570.5.\)

Step by step solution

01

(a) To find the product of likelihood and the prior function

One can get the desired product by using the conclusion in the mentioned example and the probability density functions of normal distribution and gamma distribution. The required product is a product of the following two functions

\(exp - \frac{{{u_0}{{\left( {\psi - {\psi _0}} \right)}^2}}}{2} - \int_{i = 1}^p {{\tau _i}} \beta + \frac{{{n_i}{{\left( {{\mu _i} - {{\bar y}_i}} \right)}^2} + {w_i} + {\lambda _0}{{\left( {\mu - \psi } \right)}^2}}}{2}\)

and the following expression

and\({w_i}\)is given in the same way as in the example

\({w_i} = _{j = 1}^{{n_i}}{\left( {{y_{ij}} - {{\bar y}_i}} \right)^2},\;\;\;{\kern 1pt} i = 1,2, \ldots ,p\)

The second term corresponds to the prior distribution.

02

(b) To find the conditional distributions of each parameter

As mentioned in the hint, the conditional distributions stay practically the same as in the example.

If they look at a product as a function,\({\tau _i},\)then you get a gamma distribution with parameters

\({\alpha _0} + \frac{{{n_i} + 1}}{2} and \beta + \frac{{{n_i}{{\left( {{\mu _i} - {{\bar y}_i}} \right)}^2} + {w_i} + {\lambda _0}{{\left( {\mu - \psi } \right)}^2}}}{2}\)

Next, as a function of\(\psi ,\)by writing it in a form widely known, one gets a normal distribution with parameters

Before commenting on the distribution of\(\beta .\)given all others, notice that the product above looks like a probability density function of a normal distribution when it is a function of\({\mu _i}\)for the same reason. The mean and precision are given with

\(\frac{{{n_i}{{\bar y}_i} + {\lambda _0}\psi }}{{{n_i} + {\lambda _0}}}\;\;\;{\kern 1pt} and \;\;\;{\kern 1pt} {u_0}{\tau _i}\left( {{n_i} + {\lambda _0}} \right)\)

Finally, if the product is seen as a function of\(\beta .\), it approximately probability density function of gamma distribution with parameters

03

(c) To find the prior distributions

The parameters that should be used are given in the exercise, and the others are:

\(\begin{aligned}{l}{n_1} = 20 for beef \\{n_2} = 17 for meat \\{n_3} = 17 for poultry \\{n_4} = 9 for specialty. \end{aligned}\)

Means\({\mu _i},i = 1,2,3,4\)correspond to the indices of\({n_i}, i = 1,2,3,4.\)

The code used for this simulation uses\(N = 20000\)Markov chains with\(I = 100000\)iterations or steps. It means that there is a total of\(I = 100000\)parameter vectors from which the result is obtained.

Note that the given code should be changed as the initial parameters are different. The estimated posterior means of\({\mu _i},i = 1,2,3,4\)are, respectively, 156.8, 158.4, 120.3, and 160.1. Similarly, the estimated posterior means for the\(1/{\tau _i},i = 1,2,3,4\)are, respectively,\(494.9,609.4,545.6,\)and\(570.5\)

Unlock Step-by-Step Solutions & Ace Your Exams!

  • Full Textbook Solutions

    Get detailed explanations and key concepts

  • Unlimited Al creation

    Al flashcards, explanations, exams and more...

  • Ads-free access

    To over 500 millions flashcards

  • Money-back guarantee

    We refund you if you fail your exam.

Over 30 million students worldwide already upgrade their learning with 91Ó°ÊÓ!

One App. One Place for Learning.

All the tools & learning materials you need for study success - in one app.

Get started for free

Most popular questions from this chapter

The skewness of a random variable was defined in Definition 4.4.1. Suppose that \({X_1},...,{X_n}\) form a random sample from a distribution \(F\). The sample skewness is defined as

\({M_3} = \frac{{\frac{1}{n}\sum\limits_{i = 1}^n {{{\left( {{X_i} - \bar X} \right)}^3}} }}{{{{\left( {\frac{1}{n}\sum\limits_{i = 1}^n {{{\left( {{X_i} - \bar X} \right)}^2}} } \right)}^{3/2}}}}\)

One might use \({M_3}\) as an estimator of the skewness \(\theta \) of the distribution F. The bootstrap can estimate the bias and standard deviation of the sample skewness as an estimator \(\theta \).

a. Prove that \({M_3}\) is the skewness of the sample distribution \({F_{{n^*}}}\)

b. Use the 1970 fish price data in Table 11.6 on page 707. Compute the sample skewness and then simulate 1000 bootstrap samples. Use the bootstrap samples to estimate the bias and standard deviation of the sample skewness.

Let \({\bf{Y}}\) be a random variable with some distribution. Suppose that you have available as many pseudo-random variables as you want with the same distribution as \({\bf{Y}}\). Describe a simulation method for estimating the skewness of the distribution of \({\bf{Y}}\). (See Definition 4.4.1.)

Suppose that \(\left( {{X_1},{Y_1}} \right),...,\left( {{X_n},{Y_n}} \right)\) form a random sample from a bivariate normal distribution with means \({\mu _x} and {\mu _y},variances \sigma _x^2and \sigma _y^2,and correlation \rho .\) Let R be the sample correlation. Prove that the distribution of R depends only on \(\rho ,not on {\mu _x},{\mu _y},\sigma _x^2,or \sigma _y^2.\)

Test the gamma pseudo-random number generator on your computer. Simulate 10,000 gamma pseudo-random variables with parameters a and 1 for \(a = 0.5,1,1.5,2,5,\) 10. Then draw gamma quantile plots

Use the data consisting of 30 lactic acid concentrations in cheese,10 from example 8.5.4 and 20 from Exercise 16 in sec.8,6, Fit the same model used in Example 8.6.2 with the same prior distribution, but this time use the Gibbs sampling algorithm in Example 12.5.1. simulate 10,000 pairs of \(\left( {{\bf{\mu ,\tau }}} \right)\) parameters. Estimate the posterior mean of \({\left( {\sqrt {{\bf{\tau \mu }}} } \right)^{ - {\bf{1}}}}\), and compute the standard simulation error of the estimator.

See all solutions

Recommended explanations on Math Textbooks

View all explanations

What do you think about this solution?

We value your feedback to improve our textbook solutions.

Study anywhere. Anytime. Across all devices.