Any solution for "Optimal parameters not found"? #238
-
Hello, I am trying to calculate the range value as in fit_model.percentile_scale(0.95) for a fractional cover map in a 2D raster image. the question is I am not sure how to determine what covariance model should be used here, of all the models I tried out, the Linear model gave me the best results, however, it could only make sense in dim=1. I have also tried exponential. stable and spherical models, but these models usually show an error message: Optimal parameters not found: the maximum number of function evaluations is exceeded. result in a nodata output that is not optimal. in addition, I have tried the method to determine which model fits the experimental variogram the best using the r square. but different cells have a different best fit. the problem is that I need to determine one best-fit model for all 300,000 calculations. any suggestions or feedback on this issue would be very appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hey @rivagao , For your first problem: you can increase the maximal number of function evaluations in the fitting routine by setting model.fit_variogram(bin_center, gamma, max_eval=1000) By default, this value is Maybe this is a hint, that we need to increase the default value here. For your second problem: This is hard and there is no standard way. you could try to accumulate the r2 scores for each model for all cells and then select the one with the highest overall score. Hope that helps! Cheers, Sebastian |
Beta Was this translation helpful? Give feedback.
Hey @rivagao ,
For your first problem: you can increase the maximal number of function evaluations in the fitting routine by setting
max_eval
:By default, this value is
100 * n
where n is the number of parameters. See the documentationMaybe this is a hint, that we need to increase the default value here.
For your second problem: This is hard and there is no standard way. you could try to accumulate the r2 scores for each model for all cells and then select the one with the highest overall score.
Hope that helps!
Cheers, Sebastian