An obscure integral

April 7, 2010

(This article was first published on Xi'an's Og » R, and kindly contributed to R-bloggers)

Here is an email from Thomas I received yesterday about a computation in our book Introducing Monte Carlo Methods with R:

I’m currently reading your book “Introduction to Monte Carlo Methods with R” and I quite highly appreciate your work. I’m not able to see how the integral on page 74, that describes the marginal likelihood, simplifies to the fraction on the second line. If I’m not asking too much, could you confirm to me whether the fraction is as is given in the text.

Because the transform of the integral

m(x) = int_{{mathbb R}^2_+} f(x|alpha,beta),pi(alpha,beta),text{d}alpha text{d}beta

into the ratio of two integrals

dfrac{int_{{mathbb R}^2_+} left{ frac{Gamma(alpha+beta)}{Gamma(alpha)Gamma(beta)} right}^{lambda+1}, [x x_0]^{alpha}[(1-x)y_0]^{beta} ,text{d}alpha text{d}beta}{x(1-x),int_{{mathbb R}^2_+} left{ frac{Gamma(alpha+beta)}{Gamma(alpha)Gamma(beta)} right}^{lambda}, x_0^{alpha} y_0^{beta} ,text{d}alpha text{d}beta}

may sound curious (and possibly wrong) to many readers besides Thomas, let me explain that the bottom integral is the normalisation constant of the prior

pi(alpha,beta)propto left{ frac{Gamma(alpha+beta)}{Gamma(alpha)Gamma(beta)} right}^lambda, x_0^{alpha}y_0^{beta}

while the top integral is the product of the observation density:

f(x|alpha,beta) = dfrac{Gamma(alpha+beta)}{Gamma(alpha)Gamma(beta)},dfrac{x^{alpha}(1-x)^{beta}}{x(1-x)}

and of the prior (minus the normalisation constant). Nothing wrong then with the formula at the bottom of page 74, but this is a bit short on explanations!

Filed under: Books, R, Statistics Tagged: Introducing Monte Carlo Methods with R, normalising constant, typos

To leave a comment for the author, please follow the link and comment on their blog: Xi'an's Og » R. offers daily e-mail updates about R news and tutorials on topics such as: Data science, Big Data, R jobs, visualization (ggplot2, Boxplots, maps, animation), programming (RStudio, Sweave, LaTeX, SQL, Eclipse, git, hadoop, Web Scraping) statistics (regression, PCA, time series, trading) and more...

If you got this far, why not subscribe for updates from the site? Choose your flavor: e-mail, twitter, RSS, or facebook...

Tags: , , , , ,

Comments are closed.


Mango solutions

RStudio homepage

Zero Inflated Models and Generalized Linear Mixed Models with R

Quantide: statistical consulting and training



CRC R books series

Six Sigma Online Training

Contact us if you wish to help support R-bloggers, and place your banner here.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)