Typo in Example 3.6

Edward Kao pointed out the following difficulty about Example 3.6 in Chapter 3 of “Introducing Monte Carlo Methods with R”:

I have two questions that have puzzled me for a while. I hope you can shed some lights. They are all about Example 3.6 of your book.

1. On page 74, there is a term x(1-x) for m(x). This is fine. But the term disappeared from (3.5) on p.75. My impression is that this is not a typo. There must be a reason for its disappearance. Can you elaborate?

I am alas afraid this is a plain typo, where I did not report the x(1-x) from one page to the next.

2. On page 75, you have the term “den=dt(normx,3)”. My impression is that you are using univariate t with 3 degrees of freedom to approximate. I thought formally you need to use a bivariatet with 3 degrees of freedom to do the importance sampling. Why would normx=sqrt(x[,1]^2+x[,2]^2) along with a univariate t work?

This is a shortcut that would require more explanation. While the two-dimensional t sample is y, a linear transform of the isotonic x, it is possible to express the density of y via the one-dimensional t density, hence the apparent confusion between univariate and bivariate t densities…

4 Responses to “Typo in Example 3.6”

  1. Hi all, I feel difficult to understand the calculation of the density in example 3.6, too.
    As far as I know, “den” in R code should be the density of “y”, a linear transform of “x”, as you mentioned above. However, your code involved density,

      normx = sqrt(x[,1]^2 + x[,2]^2)
      den = dt(normx,3)

    does not involve the scale of the linear transformation. I think it is incorrect because I don’t agree that the density should be invariant of the variance.

    In my opinion, the density of “y” should be the density of “x” multiple the jacobian, which is equal to 1 over square root of determinant of Sigma. The density of “x” is ” dt(x[1],3) * dt(x[2, 3) “.

    Moreover, I am confused about the part of multivariate t distribution. According to Wikipedia and other R-packages such as mnormt, the multivariate t distribution is not defined as a linear transform of tuple of i.i.d. univariate t-distribution. Since I am unfamiliar with multivariate t-distribution, I don’t know if this is another typo or not.

    • Once again, sorry for making this example such an ordeal to all readers!!!

      Question 1: You are correct in that the scale of the linear transform is indeed (one over) the square-root of the determinant of the scale matrix E. It however disappears from the ratio of the importance sampling ratios so this is correct.

      Question 1 (bis): What is wrong though is using the


      expression in the R code because, if x is a Student’s t rv in dimension 2 with 3 degrees of freedom, its density is (up to a constant)


      since the power in the density is half the dimension plus degrees of freedom, while dt is the one-D density, so involves the power half the degrees of freedom plus one.

      Question 2: You are completely correct once again. We should have generated x on page 73 as a 2D Student’s t with 3 degrees of freedom, not as two independent components. Thus, on page 73 x should be generated as


      recovering the original definition of the Student’s distribution as the ratio of a normal vector by an independent normalised chi-square rv.

  2. […] 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! On the other hand, the top of page 75 is missing an x(1-x) (and so does the R code below… See this post.) […]

  3. […] in Example 5.18 Edward Kao is engaged in a detailed parallel reading of Monte Carlo Statistical Methods and of Introducing Monte Carlo Methods with R. He has pointed […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.