lundi 26 juillet 2021

Rcpp: "overloaded function with no contextual type information" for R::dbeta

I have C++ code with the Rcpp package included.

Within a function I have the following loop:

for(int i=0; i<N; i++){
   double yi = y[i], xi = X_chain[i];
        
   double numerator = R::dbeta( yi, alpha_par, beta, log=false );
   double denumerator = R::dbeta( xi, alpha_par, beta, log=false );
   double alpha = std::min(1.0,(numerator)/(denumerator));
   
   (...)

}

where alpha_par and beta are doubles and they are the parameters of the beta distribution.

For both lines where I use the function R::dbeta I get the error "overloaded function with no contextual type information". I am really confused since runif and rbinom at different points in the code are working completely fine.




Aucun commentaire:

Enregistrer un commentaire