optimization under positivity constraint

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

optimization under positivity constraint

djiba fofana
Hi all,

I'm working on the approximation of missing value of funds which can be solve by using Optimization under positivity constraint. Is quantLib treat the minimization's programm? can anyone refer me where can i find some examples of the resolution of this kind of problem?

Thanks in advance and happy new year  

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

答复: optimization under positivity constraint

cheng li

Hi djiba,

 

As far as I know, Quantlib has such interface for constrained optimization.  You can find the base class for constraint condition is located in the file /ql/math/optimization/constraint.hpp. There is a class named PositiveConstraint defined in the same file which may meet your requirement. You can define an object of this class and simply pass this object to the problem’s constructer which located in the file/ql/math/optimization/problem.hpp. Then you are working in the framework for constrained optimization.

 

However be cautious with the results of such optimization. As I know, the optimization engines in the Quantlib (such as BFGS or LM) are good for non-constrained problems. But their effectiveness in constrained situation is doubtful.  I have set up a small test case as a least square problems for this ( test for Simplex, BFGS, ConjugateGradient,  LevenbergMarquardt methods)

 

Min(Sum(x_i �C i +5)^2), i=0 … 9.

 

The initial guess is set as (1,2,3,4,5,6,7,8,9,10)

 

1.       For no constraint problem,  all the above 4 methods converge to the correct solution (-5,-4,-3,-2,-1,0,1,2,3,4) sooner or later.

2.       For positive constraint, the above 4 methods converge to the solutions as below

a)         Simplex(Lambda = 10) : (2.54607 ,0.0480329 ,0.332641 ,1.77335e-014 ,0.00511769 ,0.615131 ,1.54132 ,2.06168 ,3.10397 ,4.35003)

b)         Conjugate Gradient: (1.74867e-008 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9)

c)         BFGS: (2.57966e-008 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9)

d)         LevenbergMarquardt: (3.46817e-007 ,1 ,2 ,3 ,4 ,5 ,6 ,7 ,8 ,9 )

All the above are not close enough to the correct answer (0,0,0,0,0,0,1,2,3,4).

 

I have attached the source file for your reference.

 

Regards,

Cheng

 

发件人: djiba fofana [mailto:[hidden email]]
发送时间: 201211 2:06
收件人: [hidden email]
主题: [Quantlib-users] optimization under positivity constraint

 

Hi all,

I'm working on the approximation of missing value of funds which can be solve by using Optimization under positivity constraint. Is quantLib treat the minimization's programm? can anyone refer me where can i find some examples of the resolution of this kind of problem?

Thanks in advance and happy new year  


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

testMain.cpp (4K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

答复: optimization under positivity constraint

cheng li
In reply to this post by djiba fofana

Hi djiba,

 

I am not quite clear about what is your positivity mean. The positivity for the object function value? Or the positivity for the variables? If it is second one, you can simply use some transformation trick to tackle this problem. For example, if you want x_1 to be positive, you can set up a dummy variable as z_1 = log(x_1). Then you model the problem on the variable z_1 rather than x_1. This transforms the constrained problem into non constrained one. In my experience, in most case, such simple transformation won’t change the well-posedness of the original problem. Simple constraint such as positivity and bounded constraint can all be treated in this way.

 

Regards,

Cheng

 

发件人: djiba fofana [mailto:[hidden email]]
发送时间: 201211 2:06
收件人: [hidden email]
主题: [Quantlib-users] optimization under positivity constraint

 

Hi all,

I'm working on the approximation of missing value of funds which can be solve by using Optimization under positivity constraint. Is quantLib treat the minimization's programm? can anyone refer me where can i find some examples of the resolution of this kind of problem?

Thanks in advance and happy new year  


------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: optimization under positivity constraint

Fabien Le Floc'h-3
Hi,

I have been studying the same issue not very long ago. Here is a doc I wrote about Nelder-Mead issues with constraints.
I agree with Cheng: for explicit constraints, a transform is often the right approach, but it can fail, even on very simple functions. The fact that a penalty or a transform fail, means that Nelder-Mead is not all that robust as in reality in those cases we are just trying to minimise a different function. For low dimensions, you should be ok.

Regards,

Fabien

On 01/01/2012 04:57 PM, 李丞 wrote:

Hi djiba,

 

I am not quite clear about what is your positivity mean. The positivity for the object function value? Or the positivity for the variables? If it is second one, you can simply use some transformation trick to tackle this problem. For example, if you want x_1 to be positive, you can set up a dummy variable as z_1 = log(x_1). Then you model the problem on the variable z_1 rather than x_1. This transforms the constrained problem into non constrained one. In my experience, in most case, such simple transformation won’t change the well-posedness of the original problem. Simple constraint such as positivity and bounded constraint can all be treated in this way.

 

Regards,

Cheng

 

发件人: djiba fofana [[hidden email]]
发送时间: 201211 2:06
收件人: [hidden email]
主题: [Quantlib-users] optimization under positivity constraint

 

Hi all,

I'm working on the approximation of missing value of funds which can be solve by using Optimization under positivity constraint. Is quantLib treat the minimization's programm? can anyone refer me where can i find some examples of the resolution of this kind of problem?

Thanks in advance and happy new year  



------------------------------------------------------------------------------
Write once. Port to many.
Get the SDK and tools to simplify cross-platform app development. Create
new or port existing apps to sell to consumers worldwide. Explore the
Intel AppUpSM program developer opportunity. appdeveloper.intel.com/join
http://p.sf.net/sfu/intel-appdev
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users

neldermead_constraints.pdf (300K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: 答复: optimization under positivity constraint

Cheng-B.Li
Thx a lot. I am reading it.


From: Fabien Le Floc'h [mailto:[hidden email]]
Sent: Monday, January 02, 2012 8:24 PM
To: [hidden email]
Subject: Re: [Quantlib-users] 答复: optimization under positivity constraint

Hi,

I have been studying the same issue not very long ago. Here is a doc I wrote about Nelder-Mead issues with constraints.
I agree with Cheng: for explicit constraints, a transform is often the right approach, but it can fail, even on very simple functions. The fact that a penalty or a transform fail, means that Nelder-Mead is not all that robust as in reality in those cases we are just trying to minimise a different function. For low dimensions, you should be ok.

Regards,

Fabien

On 01/01/2012 04:57 PM, 李丞 wrote:

Hi djiba,

I am not quite clear about what is your positivity mean. The positivity for the object function value? Or the positivity for the variables? If it is second one, you can simply use some transformation trick to tackle this problem. For example, if you want x_1 to be positive, you can set up a dummy variable as z_1 = log(x_1). Then you model the problem on the variable z_1 rather than x_1. This transforms the constrained problem into non constrained one. In my experience, in most case, such simple transformation won’t change the well-posedness of the original problem. Simple constraint such as positivity and bounded constraint can all be treated in this way.

Regards,

Cheng

发件人: djiba fofana [[hidden email]]
发送时间: 201211 2:06
收件人: [hidden email]
主题: [Quantlib-users] optimization under positivity constraint

Hi all,

I'm working on the approximation of missing value of funds which can be solve by using Optimization under positivity constraint. Is quantLib treat the minimization's programm? can anyone refer me where can i find some examples of the resolution of this kind of problem?

Thanks in advance and happy new year  



Visit our website at http://www.ubs.com

This message contains confidential information and is intended only
for the individual named.  If you are not the named addressee you
should not disseminate, distribute or copy this e-mail.  Please
notify the sender immediately by e-mail if you have received this
e-mail by mistake and delete this e-mail from your system.
       
E-mails are not encrypted and cannot be guaranteed to be secure or
error-free as information could be intercepted, corrupted, lost,
destroyed, arrive late or incomplete, or contain viruses.  The sender
therefore does not accept liability for any errors or omissions in the
contents of this message which arise as a result of e-mail transmission.  
If verification is required please request a hard-copy version.  This
message is provided for informational purposes and should not be
construed as a solicitation or offer to buy or sell any securities
or related financial instruments.

 
UBS reserves the right to retain all messages. Messages are protected
and accessed only in legally justified cases.
------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: optimization under positivity constraint

Bojan Nikolic
In reply to this post by cheng li

Hi Cheng,

As mentioned in other messages the constrained optimisation in QuantLib
is not yet very sophisticated. However you can also link in other
libraries to help with optimisation in QuantLib.

For the type of constrained problem in your message, active set
optimisation routines are very efficient.

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Reply | Threaded
Open this post in threaded view
|

Re: 答复: optimization under positivity constraint

Bojan Nikolic

jesus carrero <[hidden email]> writes:

> I have been using this library for a year or so and It is the best I
> found so far.
>
> http://forum.openopt.org/viewtopic.php?id=20
>

If you want to give it a try I also have a box-constrained L-M
implementation in my InMin library, which is in pure C++ (based on the
Eigen library). It is licensed under GPL v2.  Available for download at:

http://www.bnikolic.co.uk/inmin/inmin-library.html

Best,
Bojan

--
Bojan Nikolic          ||          http://www.bnikolic.co.uk

------------------------------------------------------------------------------
Ridiculously easy VDI. With Citrix VDI-in-a-Box, you don't need a complex
infrastructure or vast IT resources to deliver seamless, secure access to
virtual desktops. With this all-in-one solution, easily deploy virtual
desktops for less than the cost of PCs and save 60% on VDI infrastructure
costs. Try it free! http://p.sf.net/sfu/Citrix-VDIinabox
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users