<P> Hello to everyboby  Im Gianluca ....and i m a statistic student.<BR>I have one problem that i think  <EM>Dirk or some one  "good like dirk"  could help to resolve  :<BR><BR>iI would like to implement this  following function in R code  into inline code with Rccp plugin :<BR><BR>MHWG<-function (logpost, start, n.iter, burn, thin, scale, ...) <BR>{   <BR>    pb <- txtProgressBar(min = 0, max = n.iter, style = 3)<BR>    p = length(start)<BR>    vth = array(0, dim = c(n.iter/thin, p))<BR>    f0 = logpost(start, ...)<BR>    arate = array(0, dim = c(1, p))<BR>    th0 = start<BR>    for (i in (-burn):n.iter) {<BR>        setTxtProgressBar(pb, i)<BR>        for (j in 1:p) {<BR>            th1 = th0<BR>            th1[j] = th0[j] + rnorm(1) * scale[j]<BR>            f1 = logpost(th1, ...)<BR>            u = runif(1) <= min(exp(f1 - f0),1)<BR>            th0[j] = th1[j] * (u == 1) + th0[j] * (u == 0)<BR>            f0 = f1 * (u == 1) + f0 * (u == 0)<BR>            vth[floor(i/thin), j] = th0[j]<BR>            arate[j] = arate[j] + u<BR>        }<BR>    }<BR>    arate = arate/n.iter<BR>    stuff = list(par = vth, accept = arate)<BR>    return(stuff)<BR>}<BR><BR><BR>So  one argument of MHWG   is   logpost  and  is a R function with argument par where  par iso ne vector ....   for example logpost(par)   Logpost<-function(par) { ...................} (in r code).<BR>How can i call  teh logpost function into the inline rccp code . In the MHWG  there is a difference  f1-f0    where fi=logpost(par1)  e f0=logpost(par 2)  for exemple.  <BR>help me please to implemet  my problem   ...and  also i m "open" about  suggestion for implemeting  the function <BR>Sorry  for all noise and thank also for the past mail that  help me to learn more about  programming <BR>Best regards... sorrry fo rmy bad English<BR></EM></P>