I have the following problem, I am generating random values and when I run the syntax I get the following error "NA / NaN / Inf in a call to an external function (arg 5)" but this error appears when there is text in the base (at least that I read), in this case it shouldn't happen.
It should be noted that the Ars command specifies the limits of the variable x, which is in the interval 0 <x <1. The problem occurs when executing the ARS command and the simulated values of "f" are only 0
library(ars)
f<-function(x){
125*log(.5+(.25*x))+34*log(x)+38*log(1-x) +72*log(.25)
}
fprima<-function(x){
(125/(.2+.25*x))+(34/x)-(38/(1-x))
}
theta<-ars(n=10000,f,fprima,lb=TRUE,ub=TRUE,xlb=0,xub=1)
theta