Basics of fminsearch to be explained in laymens terms
이 질문을 팔로우합니다.
- 팔로우하는 게시물 피드에서 업데이트를 확인할 수 있습니다.
- 정보 수신 기본 설정에 따라 이메일을 받을 수 있습니다.
오류 발생
페이지가 변경되었기 때문에 동작을 완료할 수 없습니다. 업데이트된 상태를 보려면 페이지를 다시 불러오십시오.
이전 댓글 표시
0 개 추천
Could someone explain me in layman's terms this function? For instance, in the example:
X = fminsearch(@sin,3)
Thank you, Gaha
채택된 답변
Amit
2014년 1월 26일
In layman's term, fminsearch tries to find the minima of the function starting with the point given. Like in your case, fminsearch(@sin,3) or fminsearch(@(x) sin(x),3) tries to find the minima for sin function. The output will be the point where the minima is found. As you know, sin has minima at -1, it will find one of those values for x.
It can optimize for multivariable scenario as well. However, in fminsearch, you can not input the bounds for the variables.
Hope this is clear!
댓글 수: 9
Thanks, getting there! Two questions still: 1. What is the role of the "3" in the formula above? and 2. what values is Matlab trying to find the minimum? Is it random? For instance, in the function [given matrix]*X-[given matrix2], you tell Matlab an initial valur for X, but from there, what values does it try? Hope I made myself clear...

In the image here, you see two minima. fminsearch attempts to finds the value of the variable, where one of such minima is. You provide a initial value (in this case, its 3) from which the search starts. Depending on the initial value, you can get any of these minima. (Fminsearch does not guarantee a global minima).
For your case, you know the value of sin function is -1 at many values of x. For sin function, the minima will exist where sin(x) is -1. Try doing this: use fminsearch for sin function and give different values instead of 3 and see what you get. You'll get a different number, however all those number will a minima in that neighborhood.
I see, thanks for this explanation. Then, is it possible to not give a value from which to start? I don't quite understand why the need for giving this value.
You do need a value to start. If you dont care, you can give a random number to start with. You just have to be careful because if the function have more than one minima, then the final answer will depend on the starting point.
Also, there are other functions that you can look through - like fminbnd This actually only minimizes for a single variable function. You dont give the inital point, however you'll have to give the lower and upper bound (the range in which you expect the minima to fall).
Suppose I asked you to locate the lowest point on earth? Worse, imagine that you are blind, and can only tell what direction is locally up or down by testing with your cane? You can walk around from a starting point, moving locally down hill. Eventually when you find yourself at the very bottom of a trench and can find no direction that moves downhill, you stop, declaring the operation a "success".
This is all fminsearch does, starting with the point that you give it. If our blind searcher starts out in an area where they can walk down hill to the globally minimum point, then they will succeed in their given quest.
How could fminsearch know how to find a minimum of a completely general black box function without you giving it a starting value? Computers are not the magical things that we see in the movies and TV shows, at least not yet.
If you have these questions, it is surely time to start reading about the topic.
Nice example John.
Nice example indeed, John. Thanks, Amit, again. Just last thing. My question was also about what kind of algorithm does Matlab use to seach (from that starting condition [value]). So if it it a transformation matrix that I am looking for, and give as the initial value an IM, what will be Matlab's next try? Just randomly tries different matrices and gives as an output the one that minimizes the function? Or does it have an strategy?
Jos (10584)
2014년 1월 27일
편집: Jos (10584)
2014년 1월 27일
The search is done via a method called "Nelder-Mead simplex direct search". Here is some more information: http://www.scholarpedia.org/article/Nelder-Mead_algorithm
This method does not take derivatives (slopes) but just evaluates function values. In that sense, the word "downhill" in John's great example is a little misleading. The search is not taking the slope of the function into account, it just looks whether a level is lower or higher than another level.
That's great, thank you very much to all of you!.
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Nearest Neighbors에 대해 자세히 알아보기
태그
참고 항목
웹사이트 선택
번역된 콘텐츠를 보고 지역별 이벤트와 혜택을 살펴보려면 웹사이트를 선택하십시오. 현재 계신 지역에 따라 다음 웹사이트를 권장합니다:
또한 다음 목록에서 웹사이트를 선택하실 수도 있습니다.
사이트 성능 최적화 방법
최고의 사이트 성능을 위해 중국 사이트(중국어 또는 영어)를 선택하십시오. 현재 계신 지역에서는 다른 국가의 MathWorks 사이트 방문이 최적화되지 않았습니다.
미주
- América Latina (Español)
- Canada (English)
- United States (English)
유럽
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
