PSO Package in R always end with an error in while TRUE/FALSE needed

119 Views Asked by At

Trying to perform ANN optimization but I always get the same error which I cannot resolve. I put some trackback() in my code but nothing was returned except the error below:

Error in while (stats.iter < p.maxit && stats.feval < p.maxf && error >  : 
  missing value where TRUE/FALSE needed

Do you have already seen this error and where i can coming from?

1

There are 1 best solutions below

1
On

The error tells you that a condition was to be tested, but it evaluated to NA. In optimisation problems, this often happens when your objective function evaluates to NA for some parameter values. (But without a reproducible example, it is hard to tell what exactly went wrong.)