**M**ost embarrassingly, Liaosa Xu from Virginia Tech sent the following email almost a month ago and I forgot to reply:

I have a question regarding your example 7.11 in your book *Introducing Monte Carlo Methods with R*. To further decompose the uniform simulation by sampling a and b step by step, how you determine the upper bound for sampling of a? I don’t know why, for all y(i)=0, we need a+bx(i)>- log(u(i)/(1-u(i))). It seems that for y(i)=0, we get 0>log(u(i)/(1-u(i))). Thanks a lot for your clarification.

**T**here is nothing wrong with our resolution of the logit simulation problem but I acknowledge the way we wrote it is most confusing! Especially when switching from to in the middle of the example….

**S**tarting with the likelihood/posterior

we use slice sampling to replace each logistic expression with an indicator involving a uniform auxiliary variable

[which is the first formula at the top of page 220.] Now, when considering the joint distribution of

,

we only get a product of indicators. Either indicators that

or of ,

depending on whether *y*_{i}=1 or *y*_{i}=0. The first case produces the equivalent condition

and the second case the equivalent condition

This is how we derive both uniform distributions in and $beta$.

**W**hat is both a typo and potentially confusing is the second formula in page 220, where we mention the uniform over the set.

This set is missing (a) an intersection sign before the curly bracket and (b) a instead of the . It should be

Filed under: Books, R, Statistics Tagged: auxiliary variables, Introducing Monte Carlo Methods with R, logistic regression, slice sampling

*Related*

To

**leave a comment** for the author, please follow the link and comment on his blog:

** Xi'an's Og » R**.

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as: 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:** auxiliary variables, Books, Introducing Monte Carlo Methods with R, Logistic regression, R, slice sampling, statistics