Using fminsearch for Minimization of Two Parameters: Matlab Help

  • Context: MATLAB 
  • Thread starter Thread starter birdhen
  • Start date Start date
  • Tags Tags
    Matlab
Click For Summary
SUMMARY

The forum discussion focuses on using MATLAB's fminsearch function for minimizing two parameters, specifically H and omega, to achieve the minimum chi-squared values. Users are advised that fminsearch can be employed to optimize both parameters simultaneously, although it is important to note that it may only find local minima depending on the initial conditions provided. The discussion emphasizes the necessity of defining a function correctly and using an initial condition vector for the optimization process.

PREREQUISITES
  • Understanding of MATLAB programming
  • Familiarity with fminsearch function and its parameters
  • Knowledge of chi-squared minimization techniques
  • Ability to define functions in MATLAB
NEXT STEPS
  • Explore MATLAB's optimization toolbox for advanced minimization techniques
  • Learn about global optimization methods to avoid local minima issues
  • Investigate function handles in MATLAB for better function definition
  • Study parameter sensitivity analysis to understand the impact of initial conditions
USEFUL FOR

This discussion is beneficial for data scientists, researchers, and engineers who are utilizing MATLAB for optimization tasks, particularly those focused on parameter fitting and statistical analysis.

birdhen
Messages
31
Reaction score
0
Hi there,

I am getting confused trying to use fminsearch. I have looked at the help on Matlab but can't seem to understand how to get it to work.

I would like to find the minimum chi squared values of two parameters H and omega. I have written a function that will find the min chi squared value of H keeping omega constant, and thought that I could put this into a loop for varying values of omega, so find best H value for each value of omega. Could I use fminsearch instead to find the best fit of both values at once?
I am confused about what I need to do and any help would be greatly appreciated.

Many thanks
 
Physics news on Phys.org
Sure, you can use fminsearch to find where the function is a minimum, but it will not necessarily be a global minimum - fminsearch can get stuck in a local minimum so your answer will depend on your initial conditions. I'm not sure what information I can provide outside of MATLAB's help - I assume you know how to define a function. Without using any of the options, fminsearch takes a function and an initial condition vector as inputs (yours is a function of 2 variables, so xo [the initial condition] will be a vector).
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
8K
Replies
3
Views
7K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 6 ·
Replies
6
Views
1K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K