Optimization Question... Strange Results

조회 수: 2 (최근 30일)
Cole
Cole 2014년 10월 8일
댓글: Matt J 2014년 10월 8일
Hi,
I asked a previous question which I've moved beyond because I figured out the first problem but I'm getting weird results. I'm working towards a complex optimization problem but I'm starting by breaking it down into simpler problems to begin with. To start, I'm just trying an unconstrained optimization problem on 1 single parameter.
I have a complex routine that measures fractures in drill core automatically and compares them to a manual set of measurements that I did myself. I'm optimizing the automatic routine based on 100 manually measured photos. Once I'm happy with the results, I'm going to use these parameters to automatically measure over 5,000 photos.
The output of my function is correlation between the two sets of measurements. In my current, simple example, I'm just changing one parameter and seeing how correlation changes.
I've input the different parameters manually and get the following results:
f = 2, 4, 6, 8, 10
f(x) = 0.4, 0.45, 0.5, 0.45, 0.4
There is clearly a peak at f = 6... that's the optimal result.
However, with the optimizer, no matter what starting point I try, it says that point is the optimal result.
I've formulated it as follows:
opt0 = 4;
options = optimoptions(@fminunc,'Algorithm','quasi-newton');
[opt,fval,exitflag,output] = fminunc(@objfun1,opt0,options);
If I use 4 as my starting location, I get 0.45 as my optimal result. If I try 6 as my starting point, I get 0.5 as my optimal result. It doesn't seem to iterate over any different values correctly.
I'm not sure what's going on.
I'm working towards a complex problem where I'm going to optimize 6 different parameters with a bunch of constraints and bounds but I would like to get this working first.
  댓글 수: 1
Matt J
Matt J 2014년 10월 8일
There is clearly a peak at f = 6... that's the optimal result.
You are using "f" to mean 2 different things, which is terribly confusing. Don't you mean that f(x) has a peak at x=6?
In any case, my guess is that objfun1() contains rounding or other quantization operations, which make all your points locally optimal. To say more, we really need to see the contents of objfun1.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Get Started with Optimization Toolbox에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by