A local optimisation function 'fminsearch' (also known as the 'downhill simplex' method) is for unconstrained parameter ranges. If we need to do optimisation for constrained parameter ranges, we need to create periodic functions to map the unconstrained parameter space to the constrained parameter space.
This function 'mapping_parameters.m' is to help to transfer unconstrained range to a customed constrained range, then enable the 'fminsearch' function to be used to the constrained problems.
==========================================================================================
Matlab codes and example:
*Pseudo code for objective function evaluation
>> obj = obj_fun(p)
1. Define constraints a and b either locally or globally
2. Access other data as needed for evaluating obj_fun
3. Map p to p* (repeat for all p) (Matlab code mapping_parameters)
4. Work out obj = obj_fun(p*)
>> return obj_fun value
*To search for optimum p
>> p = fminsearch(obj_fun,p0,options)
==========================================================================================
Suggestions
* It is recommended to re-run at least once the downhill simplex search using the last found p as p0.
* After the search is finished, map the found p to p*. p* is the solution.
* Note that when using a local search method, you may need to repeat the whole search
* Procedure many times with different starting points
引用格式
QJ Wang & Jie Jian (2020). Mapping parameters for Matlab code 'fminsearch' (https://www.mathworks.com/matlabcentral/fileexchange/<...>), MATLAB Central File Exchange. Retrieved January 9, 2020.
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!