Monday, June 21, 2010

Exploring Optimization routines in Python: OpenOpt

Scipy comes with a built-in optimization tools in its optimize module but we will sbe using the more modern OpenOpt framework/library with Python. Ubuntu offers two flavors of openopt packages for Python: python-openopt and scikits-openopt and installing one will remove the other package!

OpenOpt has related superb automatic differentiation support in FuncDesigner.

OpenOpt is developed in the Ukraine and its homepage is at http://openopt.org.
It now finds wide adoption and widespread applications.From its Applications page, we see the following:

       
  • Small Aerial Vehicle Trajectory Planning; University of California, Berkeley, & University of Waterloo (pdf)
       
  • sagemath.org, SAGE - a viable free open source alternative to Magma, Maple, Mathematica and Matlab
       
  • pymvpa.org (Multivariate Pattern Analysis)
       
  • PythonXY (www.pythonxy.com)
       
  • Carnegie Mellon University started to teach students OpenOpt
       
  • simplemax.net online services
       
  • enthought.com repository and educational courses . The Enthought guys are very smart! - they ignored to answer my email with proposition of collaboration but involved my soft without even notification to me.
       
  • Measuring Inconsistency in Probabilistic Knowledge Bases; Technische Universitat Dortmund, Germany
       
  • Bayesian Inference Package (probabilistic calculations), Gulbenkian Institute of Science in Portugal
       
  • IdentiPy, parameter optimization and inverse problems for materials computation
       
  • Multiple-Shooting Optimization using the JModelica.org Platform; Lund University, Sweden
       
  • Optimal design of complex energy facilities (Ukraine, pdf, no English translation is available)


If you are a Ubuntu user, then installing openopt is a snap. The version I have is  

Importing openopt in ipython, we see that applying the dir() function provides the following major classes/routines:

'CDFP', 'CGLP', 'CLLAVP', 'CLLSP', 'CLP', 'CLUNP', 'CMILP', 'CMINLP',
 'CMMP', 'CNLLSP', 'CNLP', 'CNLSP', 'CNSP', 'CQP', 'CSDP', 'CSLE', 'CSOCP',
 'DFP', 'GLP',  'LLAVP', 'LLSP', 'LP', 'LUNP', 'MILP', 'MMP', 'NLLSP', 'NLP', 'NLSP', 'NSP', 'OpenOptException',
 'QP', 'SDP',  'SLE', 'SOCP'

Problem classes which may be solve by OpenOpt are the following:


Problems
DFPDataFit Problems
GLPGLobal Problems
LLAVPLinear Least Absolute Value Problems
LUNPLinear Uniform Norm Problems
MINLPMixed Integer Nonlinear Problems
MMP    MiniMax Problems
NLLSPNon-linear Least Square Problems
NLPNon-linear Problems
NLSPNon-linear System Problems
NSPNon-smooth Problems
QPQuadratic Problems
SDPSemi-Definite Problems
SOCPSecond Order Cone Problems


To be continued!


The version Ubuntu installs is .27 when the latest is .29!

We install FuncDesigner separately as it is not in any Ubuntu repository.


This is article is an introduction. We will expound further each important feature of openopt when we have the free time.


Our most pressing application is to use openopt to determine the parameters of an ARMA process. Stay tuned.

You can easily install 3 packages openopt, funcdesigner and derapproximator by typing


sudo easy_install openopt
sudo easy_install FuncDesigner
sudo easy_install DerApproximator


I thought it would get the latest versions. Not!

This set of packages will sure to invite some people who pine for Matlab but cannot afford the hefty price tag!

No comments:

Post a Comment