**I** received the following email about *Introducing Monte Carlo Methods with R* a few days ago:

Hallo Dr. Robert,

I am studying your fine book for myself. There´s a little problem in examples 7.17 and 8.1: in the R code a function “*gu*” is used and a reference given to ex. 5.17, but I cann´t find there a definition of “*gu*“. (*gu = log formula (5.15)* ?) Could you give me a hint?

from Elmar Kisslinger. Indeed, the *gu* function used in this analysis of the logit model is not available in the book, it is provided by

#function for MCMC
gu=function(mu,i,beta,sigma){
sum((y[i,]*(beta*x[i,]+mu))-log(1+exp(beta*x[i,]+mu)))-0.5*mu^2/sigma^2
}

and is only available in the associated mcsm R package as part of the *randogit.R* code. (Incidentally, this is my 1500th post on the ‘Og! And this coincides with the 3000th comment…)

Filed under: Books, R, Statistics, University life Tagged: Introducing Monte Carlo Methods with R, mcsm

*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:** Books, Introducing Monte Carlo Methods with R, mcsm, R, statistics, University life