forum.alglib.net

ALGLIB forum
It is currently Sun Dec 22, 2024 11:27 pm

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: maximize function of two variables
PostPosted: Wed Jul 11, 2012 3:38 am 
Offline

Joined: Wed Jul 11, 2012 3:22 am
Posts: 2
Hello All -

First of all, thank you very much for providing such a great library and an invaluable learning resource.

I have a function of two variables which I'd like to maximize using Alglib for C#. I've decided to use the BFGS optimizer, only passing in the function, no gradient. After reading through the reference manual, it looks like the call to alglib.minlbfgssetcond() is where I define the conditions for the optimization. In the manual, however, it's not clear how I would specify that I'm looking to maximize the function result. I'm thinking I just need to pass in a value for the EpsF argument, but which value would tell the library that I'm looking for a max? Also, is it valid to pass in zeroes for the other arguments? Will that change the optimization?

I'm very new to this, so I apologize in advance for the rookie nature of these questions.

Thanks for your help.

- MrBrownstone


Top
 Profile  
 
 Post subject: Re: maximize function of two variables
PostPosted: Wed Jul 11, 2012 6:09 am 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
1. You can minimize g(x)=-f(x) instead of maximizing f. There is no way to tell ALGLIB optimizer that it should maximize instead of minimization, but it is easy to replace maximization by minimization.
2. You can set one of the stopping criteria to non-zero value and set other ones to zero. Algorithm will correctly stop using the only non-zero criteria.


Top
 Profile  
 
 Post subject: Re: maximize function of two variables
PostPosted: Wed Jul 11, 2012 10:52 am 
Offline

Joined: Wed Jul 11, 2012 3:22 am
Posts: 2
Sergey -

Thank you very much for the prompt response. I will give this a try today.

-MrBrownstone


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: Bing [Bot] and 34 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group