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

To solve 1D problem by adding 5% change at each step in Optim.jl methods #965

Closed
mana2025 opened this issue Dec 11, 2021 · 2 comments · Fixed by #966
Closed

To solve 1D problem by adding 5% change at each step in Optim.jl methods #965

mana2025 opened this issue Dec 11, 2021 · 2 comments · Fixed by #966

Comments

@mana2025
Copy link

I am trying to use equivalent for fminsearch in Matlab for 1D problem. There are two issues here:
1- fminsearch uses Neldermead for scalar and works well. It looks like optim.jl cannot be called to solve 1d problem using Nelder mead
2- fminsearch gets an initial guess. At each step it changes the initial guess by 5% until convergence. In julia there are ways of changing NelderMead to comply with that (initial_simplex). Optim.jl also offers Brent() and Goldensection() for 1d, but, neither of those accept initial guess. They both need a bound.

I have a complicated code (both in Matlab and Julia). User can choose among some parameters to optimize some of them. This works well in Matlab since single parameter can be picked as well. In Julia I used "if condition" to switch to Brent(). Based on the problem the bound might change. I am looking for a way of using 5% change from initial guess (or 5% change from mid point of a more general bound). I think Brent uses the mid point of the bound as initial value. Which is totally fine. But the problem happens when for the next step the new guess is significantly different from former one. This could cause NAN in my calculation (due to the number being physically unacceptable). So the question is: Is there any 1D solver which operates by changing 5% from initial guess?

@pkofod
Copy link
Member

pkofod commented Dec 13, 2021

Someone recently asked about the nelder mead restriction. I think it can be lifted for 1d problems (such that it runs)

@mana2025 mana2025 reopened this Dec 14, 2021
@mana2025
Copy link
Author

Thanks! That would be awesome!

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

Successfully merging a pull request may close this issue.

2 participants