Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix exercise 5 in repeated binary trials #97

Open
2 tasks
bob-carpenter opened this issue Feb 27, 2017 · 0 comments
Open
2 tasks

Fix exercise 5 in repeated binary trials #97

bob-carpenter opened this issue Feb 27, 2017 · 0 comments
Assignees
Labels

Comments

@bob-carpenter
Copy link
Contributor

Gertjan Verhoeven pointed out a bug in exercise 5. That was based on exercise 5.9(b) of BDA 3 (p. 136). But the phrasing was botched int he text and exercise. It should be as follows.

BDA 3, Problem 5.9(b):

Assume p(alpha / (alpha + beta), alpha + beta) is uniform and show that

p(alpha, beta) propto (alpha + beta)^{-5/2}.

First note that alpha, beta > 0.

Step 1. Let

f(kappa) = kappa^{-0.5} = gamma

so that

f^{-1}(gamma) = gamma^{-2} = kappa

and assume a uniform so that that p_G(gamma) = const. Then with the usual change of variables, we get

p_K(kappa) = p_G(f^{-1}(kappa)) | d/d.kappa f^{-1}(kappa) |

  = const | d/d.kappa kappa^{-0.5} |

  propto kappa^{-1.5}

Step 2. Compute the Jacobian of the inverse transform h, defined by

h(alpha, beta) = (alpha / (alpha + beta), (alpha + beta))

the Jacobian of which is

J_h

= |  d/d.alpha (alpha / (alpha + beta))      d/d.alpha (alpha + beta)  |
  |  d/d.beta (alpha / (alpha + beta))        d/d.beta (alpha + beta)  |

= | beta / (alpha + beta)^2       1 |
  | - alpha / (alpha + beta)^2    1 |

which using the rule for determinants for 2 x 2 matrices, provide an absolute Jacobian determinant of:

|J_h| = (alpha + beta)^{-1}

Step 3. Multiply the distribution from Steps 1 and 2 by the absolute Jacobian determinant to adjust for change of variables, and the final result is

p(alpha, beta)
  = (alpha + beta)^{-3/2} * (alpha + beta)^{-1}
  = (alpha + beta)^{-5/2}

Or you could just put the two bits together and derive the compound Jacobian, but it seems clearer this way in two steps.

  • fix text motivation for prior

  • fix exercise and give a big hint

@bob-carpenter bob-carpenter self-assigned this Feb 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant