Package: pdfo
PDFO: Powell's Derivative-Free Optimization solversIntroduction|Python|MATLAB|Citing PDFO|AcknowledgmentsDedicated to the late ProfessorM. J. D. PowellFRS (1936–2015).IntroductionPDFO (Powell's Derivative-Free Optimization solvers) is a cross-platform package
providing interfaces for using the late ProfessorM. J. D. Powell'sderivative-free optimization solvers, including UOBYQA, NEWUOA, BOBYQA, LINCOA,
and COBYLA. See thePDFO homepageand thePDFO paperfor more information.This package makes use of a modified version ofPowell'sFortran code. See the folderoriginalunderfsrcforPowell'soriginal code.Python version of PDFOInstallationRecommended installationTo use the Python version of PDFO on Linux, Mac, or Windows, you needPython(version 3.8 or above).It is highly recommended to install PDFO viaPyPI.Installpipin your system if
you Python version does not include it. Then executepipinstallpdfoin a command shell (e.g., the terminal for Linux and macOS, or the Command
Shell for Windows). If your pip launcher is notpip, adapt the
command accordingly (it may bepip3for example). If this
command runs successfully, PDFO is installed. You may verify the
installation bypython-munittestpdfo.testpdfoOnce again, if your Python launcher is notpython, adapt the command accordingly (it may bepython3for example).
If you are an Anaconda user, PDFO is also available through the conda installer
(https://anaconda.org/conda-forge/pdfo). However, it is not managed by us.Alternative installation (using source distribution)Alternatively, although deeply discouraged, PDFO can be installed from the
source code. It requires you to install additional Python headers, a Fortran
compiler (e.g.,gfortran), andF2PY(provided byNumPy).
Download and decompress thesource code package,
or clone it fromGitHuborGitee.
You will obtain a folder containingpyproject.toml; in a command shell,
change your directory to this folder; then install PDFO by executingpipinstall.UsagePDFO provides a Python functionpdfo, which can solve general constrained or unconstrained optimization problems without using derivatives.Thepdfofunction can automatically identify the type of your problem and then call one of Powell’s solvers, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA.
The user can also specify the solver by setting themethodfield of the options passed topdfo.Thepdfofunction is designed to be compatible with thescipy.optimize.minimizefunction ofSciPy. You can call pdfo in exactly the same way as callingscipy.optimize.minimizeexcept thatpdfodoes not accept derivative arguments.For the detailed syntax ofpdfo, use the standardhelpcommand
of Python:frompdfoimportpdfohelp(pdfo)UninstallPDFO can be uninstalled by executing the following command in a command shell:python3-mpipuninstallpdfoMATLAB version of PDFOPrerequisitesPDFO supports MATLAB R2014a and later releases. To use PDFO, you need first
set up theMEXof your
MATLAB so that it can compile Fortran.The setup of MEX is a pure MATLAB usage problem and it has nothing to do with PDFO.To see whether your MEX is ready, run the following code in MATLAB:mex('-setup','-v','fortran');mex('-v',fullfile(matlabroot,'extern','examples','refbook','timestwo.F'));If this completes successfully, then your MEX is ready. Otherwise, it is not, and
you may try thesetup_mexpackageathttps://github.com/equipez/setup_mexIt will help you to set MEX up on Windows or macOS (the setup of MEX is trivial on Linux).
In casesetup_mexdoes not work, you need to consult a local MATLAB expert or the technical support of
MathWorks about "how to set up MEX", which isnotpart of PDFO.InstallationDownload and decompress thesource code package,
or clone it fromGitHuborGitee.
You will obtain a folder containingsetup.m. Place this folder at the location
where you  want PDFO to be installed. In MATLAB, change the directory to this
folder, and execute the following command:setupIf this command runs successfully, PDFO is installed. You may execute the
following command in MATLAB to verify the installation:testpdfoUsagePDFO provides a MATLAB functionpdfo, which can solve general constrained or unconstrained optimization problems without using derivatives.Thepdfofunction can automatically identify the type of your problem and then call one of Powell’s solvers, namely COBYLA, UOBYQA, NEWUOA, BOBYQA, and LINCOA.
The user can also specify the solver by setting thesolverfield of the options passed topdfo.Thepdfofunction is designed to be compatible with thefminconfunction available in theOptimization Toolboxof MATLAB.
You can callpdfoin the same way as callingfmincon. In addition,pdfocan be called in some flexible ways that are not supported byfmincon.For detailed syntax ofpdfo, use the standardhelpcommand
of MATLAB:helppdfoUninstallPDFO can be uninstalled using the setup.m script by executing the following
command in MATLAB:setupuninstallCiting PDFOIf you use PDFO, please cite the following paper. Note that PDFO contains improvements and bug fixes that do not exist in Powell's original code. See Subsections 4.3--4.5 of the paper for details.[1] T. M. Ragonneau and Z. Zhang,PDFO: a cross-platform package for Powell's derivative-free optimization solvers, arXiv:2302.13246, 2023.@misc{Ragonneau_Zhang_2023,title={{PDFO}: a cross-platform package for {Powell}'s derivative-free optimization solvers},author={Ragonneau, T. M. and Zhang, Z.},howpublished={arXiv:2302.13246},year=2023}In addition, Powell’s methods can be cited as follows.[2] M. J. D. Powell. A direct search optimization method that models the objective and constraint functions by linear interpolation. In S. Gomez and J. P. Hennart, editors,Advances in Optimization and Numerical Analysis, pages 51–67, Dordrecht, NL, 1994. Springer.[3] M. J. D. Powell. UOBYQA: unconstrained optimization by quadratic approximation.Math. Program., 92:555–582, 2002.[4] M. J. D. Powell. The NEWUOA software for unconstrained optimization without derivatives. In G. Di Pillo and M. Roma, editors,Large-Scale Nonlinear Optimization, volume 83 ofNonconvex Optimization and Its Applications, pages 255–297, Boston, MA, USA, 2006. Springer.[5] M. J. D. Powell. The BOBYQA algorithm for bound constrained optimization without derivatives. Technical Report DAMTP 2009/NA06, Department of Applied Mathematics and Theoretical Physics, University of Cambridge, Cambridge, UK, 2009.Remark:LINCOA seeks the least value of a nonlinear function subject to
linear inequality constraints without using derivatives of the objective
function. Powell did not publish a paper to introduce the algorithm.AcknowledgmentsPDFO is dedicated to the memory of the late ProfessorPowellwith gratitude for his inspiration and for the treasures he left to us.We are grateful to ProfessorYa-xiang Yuanfor his
everlasting encouragement and support.The development of PDFO is a long-term project, which would not be sustainable without the continued
funds from theHong Kong Research Grants Council(ref. PolyU 253012/17P, PolyU 153054/20P, and PolyU 153066/21P),
theHong Kong Ph.D. Fellowship Scheme(ref. PF18-24698),
and theHong Kong Polytechnic University(PolyU),
in particular theDepartment of Applied Mathematics(AMA).