Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in if (fun >= 0) return(1/(fun + 1)) else return(1 + abs(fun)) : missing value where TRUE/FALSE needed #1

Open
gvegayon opened this issue Mar 26, 2015 · 1 comment
Assignees
Labels

Comments

@gvegayon
Copy link
Owner

Richard Hodgett writes:

Hi George,

Thank you so much for creating the ABCoptim R package. I am using it to demonstrate ABC with my MSc students.

I have run into a problem which I hope you can help me with. I am trying to use abc_optim() with problems from the globalOptTests package.

Some of the problems in globalOptTests package throw errors:

abc_optim(fn=goTest, fnName="Camel6", par=c(0,0))
Error in if (fun >= 0) return(1/(fun + 1)) else return(1 + abs(fun)) :
missing value where TRUE/FALSE needed
abc_optim(fn=goTest, fnName="Camel3", par=c(0,0))
Error in if (fun >= 0) return(1/(fun + 1)) else return(1 + abs(fun)) :
missing value where TRUE/FALSE needed
abc_optim(fn=goTest, fnName="Powell", par=c(0,0,0,0))
Error in if (r < prob[i]) { : missing value where TRUE/FALSE needed
abc_optim(fn=goTest, fnName="Wood", par=c(0,0,0,0))
Error in if (fun >= 0) return(1/(fun + 1)) else return(1 + abs(fun)) :
missing value where TRUE/FALSE needed

Whilst some of the problems work fine:

abc_optim(fn=goTest, fnName="Ackleys", par=c(0,0,0,0,0,0,0,0,0,0))
$par
[1] -6.623080e+297 -6.623080e+297 -6.623080e+297 -5.879277e+297 -6.623080e+297 -6.623080e+297 -6.623080e+297 -6.623080e+297
[9] -6.623080e+297 -6.623080e+297

$value
[1] 20.00523

$counts
function
53

Is there something I need to define to make the abc_optim() work with the problems that throw the “missing value where TRUE/FALSE needed” error?

Many thanks for any help you can provide,
Kind regards,
Richard

Dr. Richard Edgar Hodgett
Lecturer in Business Analytics and Decision Science

@gvegayon gvegayon added the bug label Mar 26, 2015
@gvegayon gvegayon self-assigned this Mar 26, 2015
@gvegayon
Copy link
Owner Author

Hi Richard,

Thanks for writing me. For what you are saying it seems to me that the problem has to do with empty lists, this is, somehow some objects within the abc_optim function are length zero which is why I think returns that error "missing value TRUE/FALSE". I will add this as a bug and correct it for the next version (which I'm affraid I'm not able to say when I'm going to start working on).

Thanks a lot for finding it!

George

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant