<HTML>
<HEAD>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<META content="OPENWEBMAIL" name=GENERATOR>
</HEAD>
<BODY bgColor=#ffffff>
Hello,
<br />
<br />  I spent last weekend trying to run this piece of code (and a lot of variations too):
<br />
<br />suppressPackageStartupMessages(require(inline))
<br />suppressPackageStartupMessages(require(Rcpp))
<br />
<br />vero.empi.cpp &lt;- '
<br />  Rcpp::NumericVector xa(vpf) ;
<br />  Rcpp::NumericVector xb(vpe) ;
<br />  Rcpp::NumericVector xc(tempo) ;
<br />  Rcpp::NumericVector xd(evento) ;
<br />  int n_xa = xa.size(), n_xb = xb.size(), n_xd = xd.size() ;
<br />  Rcpp::NumericMatrix vero(n_xa,n_xb)
<br />  Rcpp::Function d(fun1) ;
<br />  Rcpp::Function S(fun2) ;
<br />  float aux ;
<br />  for (int i = 0; i &lt; n_xa; i++){
<br />    for (int j = 0; j &lt; n_xb; j++){
<br />      aux = 0 ;
<br />      for(int k = 0; k &lt; n_xd; k++){
<br />      aux = aux*(d(xc[k], xa[i], xb[j])^xd[k])*(S(xc[k], xa[i], xb[j])^(1- xd[k])) ;
<br />      }
<br />      vero[i , j] = aux ;
<br />    }
<br />  }
<br />  return vero;
<br />'
<br />
<br />vero.empi &lt;- cxxfunction(
<br />  signature(vpf=&quot;numeric&quot;, vpe=&quot;numeric&quot;, tempo=&quot;numeric&quot;, evento=&quot;numeric&quot;, fun1 = &quot;function&quot;, fun2 = &quot;function&quot;),
<br />  vero.empi.cpp, plugin=&quot;Rcpp&quot;, include = &quot;using namespace Rcpp; &quot;)
<br />
<br />The purpose here is to generate a matrix of empirical values of a likelihood. For a first trial, I would like to use the R functions dweibull() and pweibull() in fun1 and fun2, respectively. But it didn't work for some reason I cannot see. Is this possible?
<br />
<br />
<br />Thanks,
<br />Prof. Hermes
<br />PS.: Sorry for my bad English!
<br />


</BODY>
</HTML>