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

Infinite values of the Deviance Function, unable to find optimum parameters #36

Open
petbadger opened this issue Jun 14, 2018 · 2 comments

Comments

@petbadger
Copy link

Just an FYI in case anyone gets a GP_deviance error. Thought I should share this, in the obscure chance it will help someone else. Took me a good 2 hours of horsing around before I found the issue.

I was playing with this example: http://rpubs.com/tdneumann/351073 which produces the error:

Error in GP_deviance(param_init_200d[i, ], X, Y, nug_thres, corr = corr) :
Infinite values of the Deviance Function,
unable to find optimum parameters

rBayesianOptimization imports GPfit, which has the GP_deviance function.

My silly and futile first attempt was to replicate the Rpubs example as best I could: Use Rstudio, subset the dataset to Dec 22, 2017 when the post was created, run rBayesianOptimization version 1.1.0 and GPfit version 1.0-0. Though neither of these packages appear to have been updated since the Rpubs post.

I ran my own time series data through it, and I got the same error.

Then I stumbled on what seemed to cause the issue. The Rpubs article sets init_points = 0 in the call to BayesianOptimization. Setting this to an integer greater than 0 makes the code work.

Note:
Out of the fire and into another, running it with init_points=1 resulted in a warning: "In .local(object, ...) : non-zero return code in optimizing". Not sure what that's about, but the results appear good.

@petbadger
Copy link
Author

When I was using my own dataset, I actually will get the same error. It appears to have to do with the parameter ranges. If one of these are wacky, it produces a Value of NaN which I think contributes to the GP deviance error.

@csetzkorn
Copy link

csetzkorn commented Jun 25, 2020

My init_points is greater 0 and my bounds work for most series (I loop over them). Is there another way to overcome this please? I tried using tryCatch in my loss/aqu. function. Thanks.

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

No branches or pull requests

2 participants