Message Boards Message Boards

0
|
10560 Views
|
3 Replies
|
5 Total Likes
View groups...
Share
Share this post:

Avoid issues with Minimize, Argmin and other optimization functions?

Posted 7 years ago

I am trying to optimize (minimize) the absolute value of a expression (finding the point at which it is closest to zero) using functions Argmin and Minimize. I am facing following issues and will appreciate any suggestion.

  1. Though I am using the same constraints on variables, Argmin and Minimize functions are giving close but different values of variables. I could find any specific details on Documentation/help section about the difference between the two functions and which o/p I should trust more.

  2. Even for function "Minimize", everytime I evaluate the i/p, I get slightly different values of function at minima and variables. Why it is so.

  3. I noticed there are many other functions like NMinimize, FindMinimum, ArgMin, NArgMin etc, which by definition can fulfill my requirement, but I am not sure about the difference among them and which one I should use ? Can i somewhere find a comparative use of these functions and understand for what kind of application they are most appropriate.

thanks a lot !!

SG

POSTED BY: S G
3 Replies

One thing to watch out for is that the symbolic functions such as Minimize switch to numerical methods if the inputs are not infinite precision.

POSTED BY: Frank Kampas

Like Sander Huisman said, it is hard to say much without some code to look at. In any case, I can wildly speculate about some of these. (Note that I am answering these out of order.)

3: The functions here that start with "N" are functions that will try to evaluate numerically. For example, Minimize can minimize a symbolic expression.

In[]:= Minimize[(x + y)^2, x]
Out[]= {0, {x -> -y}}

NMinimize on the other hand needs an expression that it can minimize numerically, so this particular example would not work with (because y is not defined). Unlike Minimize though, which will automatically try to to minimize numerically if it can't symbolically, NMinimize just tries to do it numerically and so gives you some more options to specify how you want it to sample and so on (if you need to specify things like that). That is the difference between all of these functions and there "N" equivalents (that is, NMinimize is to Minimize as NArgMin is to ArgMin, etc).

The only other difference between the functions you named are the way they structure input and output. Minimize will return the same information as ArgMin, but ArgMin doesn't bother to return the minimal value like Minimize does. The difference is just for convenience.

1 and 2: If the difference is just convenience, why do they sometimes get different answers? If they can run symbolically, they should get exactly the same answer. However, they might be running numerically. Depending on the method it uses, these processes can be non-deterministic. If it chooses Method -> "MonteCarlo" for example, depending on the points it samples it might get a different answer.

Please post a minimal example of your code. You might need additional precision, different method, different starting condition et cetera. We have no idea what you're trying...

Read: http://community.wolfram.com/groups/-/m/t/270507

POSTED BY: Sander Huisman
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract