Powell's Derivative-Free Optimization solvers
Project description
PDFO: Powell's Derivative-Free Optimization solvers
Introduction | Python | MATLAB | Citing PDFO | Acknowledgments
Dedicated to the late Professor M. J. D. Powell FRS (1936–2015).
Introduction
PDFO (Powell's Derivative-Free Optimization solvers) is a cross-platform package providing interfaces for using the late Professor M. J. D. Powell's derivative-free optimization solvers, including UOBYQA, NEWUOA, BOBYQA, LINCOA, and COBYLA. See the PDFO homepage and the PDFO paper for more information.
This package makes use of a modified version of Powell's
Fortran code. See the folder original
under fsrc
for Powell's original code.
Python version of PDFO
Installation
Recommended installation
To use the Python version of PDFO on Linux, Mac, or Windows, you need Python (version 3.8 or above).
It is highly recommended to install PDFO via PyPI.
Install pip in your system if you Python version does not include it. Then execute
pip install pdfo
in a command shell (e.g., the terminal for Linux and macOS, or the Command
Shell for Windows). If your pip launcher is not pip
, adapt the
command accordingly (it may be pip3
for example). If this
command runs successfully, PDFO is installed. You may verify the
installation by
python -m unittest pdfo.testpdfo
Once again, if your Python launcher is not python
, adapt the command accordingly (it may be python3
for 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), and
F2PY (provided by
NumPy).
Download and decompress the source code package,
or clone it from GitHub or Gitee.
You will obtain a folder containing pyproject.toml
; in a command shell,
change your directory to this folder; then install PDFO by executing
pip install .
Usage
PDFO provides a Python function pdfo
, which can solve general constrained or unconstrained optimization problems without using derivatives.
The pdfo
function 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 the method
field of the options passed to pdfo
.
The pdfo
function is designed to be compatible with the scipy.optimize.minimize function of SciPy. You can call pdfo in exactly the same way as calling scipy.optimize.minimize except that pdfo
does not accept derivative arguments.
For the detailed syntax of pdfo
, use the standard help
command
of Python:
from pdfo import pdfo
help(pdfo)
Uninstall
PDFO can be uninstalled by executing the following command in a command shell:
python3 -m pip uninstall pdfo
MATLAB version of PDFO
Prerequisites
PDFO supports MATLAB R2014a and later releases. To use PDFO, you need first set up the MEX of 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 the setup_mex
package at
https://github.com/equipez/setup_mex
It will help you to set MEX up on Windows or macOS (the setup of MEX is trivial on Linux).
In case setup_mex
does not work, you need to consult a local MATLAB expert or the technical support of
MathWorks about "how to set up MEX", which is
not part of PDFO.
Installation
Download and decompress the source code package,
or clone it from GitHub or Gitee.
You will obtain a folder containing setup.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:
setup
If this command runs successfully, PDFO is installed. You may execute the following command in MATLAB to verify the installation:
testpdfo
Usage
PDFO provides a MATLAB function pdfo
, which can solve general constrained or unconstrained optimization problems without using derivatives.
The pdfo
function 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 the solver
field of the options passed to pdfo
.
The pdfo
function is designed to be compatible with the fmincon
function available in the Optimization Toolbox of MATLAB.
You can call pdfo
in the same way as calling fmincon
. In addition, pdfo
can be called in some flexible ways that are not supported by fmincon
.
For detailed syntax of pdfo
, use the standard help
command
of MATLAB:
help pdfo
Uninstall
PDFO can be uninstalled using the setup.m script by executing the following command in MATLAB:
setup uninstall
Citing PDFO
If 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 of Nonconvex 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.
Acknowledgments
PDFO is dedicated to the memory of the late Professor Powell with gratitude for his inspiration and for the treasures he left to us.
We are grateful to Professor Ya-xiang Yuan for his everlasting encouragement and support.
The development of PDFO is a long-term project, which would not be sustainable without the continued funds from the Hong Kong Research Grants Council (ref. PolyU 253012/17P, PolyU 153054/20P, and PolyU 153066/21P), the Hong Kong Ph.D. Fellowship Scheme (ref. PF18-24698), and the Hong Kong Polytechnic University (PolyU), in particular the Department of Applied Mathematics (AMA).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for pdfo-2.2.0-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d8485a3207110cfe13ce285ec606ecaec3b95ad2e89d26cacd2315af50b8a358 |
|
MD5 | 86e8cd48e9430afcbbb0305498a487c8 |
|
BLAKE2b-256 | ab7a7874c30d1f323fb8b90367c43afbe8c695c623a36017afd035e717fc6446 |
Hashes for pdfo-2.2.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 57a8a5c27bfcc80ed25df0f811ff33cffba09f317296fd8de123a44a372cf94b |
|
MD5 | a4ece441fb756ed63ecb4481477405f5 |
|
BLAKE2b-256 | cfe2edfd64dcd42e96187b20e4d92ee75f090c4b4035b56531a39cd2b227d896 |
Hashes for pdfo-2.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65d07ec2739d1089309a90a42f13c6c7934dbe70618fccffb14d42d85322d748 |
|
MD5 | f06d56cfe5523366f1d8e5e27d596e09 |
|
BLAKE2b-256 | 482addc4f4a463f27cab8d849619c18a9ad48fe671171698c9d9619ef74442fe |
Hashes for pdfo-2.2.0-cp312-cp312-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85ae1231a624939b79dfaa6dd317fd8fecc6cd5a366e9790fdfca5e359ac44d6 |
|
MD5 | 388580c243717bc403fdeb35b21e7ec1 |
|
BLAKE2b-256 | d59e907e6a449fbf25f1b2c43ca430f4a367ad2480dafd675e4119f5cfb2d7b1 |
Hashes for pdfo-2.2.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5cd695c1c2e5597ea2df30eb6cb577f0901b3103a407824c945589836aa6806b |
|
MD5 | f55394045b46379593898e6dc884d30a |
|
BLAKE2b-256 | 60a878c88c2bbf6c4a80897d60033b100a764b99f563bcce30a77ff4a8ca8140 |
Hashes for pdfo-2.2.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33baca6c6875edc86c13963568a46dcf5536d4c89643692c905994aa4b78f22d |
|
MD5 | 99573572014bf9a013199c0949f7b81b |
|
BLAKE2b-256 | 16d60457b94f469e432ef15a8296ab4647ea34b174b2b93ae95a731e00c00ee1 |
Hashes for pdfo-2.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 43a0f72078a0adf0c7d04194ab678c69df31974adf561e10e0e61d2f7c31427d |
|
MD5 | 4f47edbac180bf728021d0e76cdb10e8 |
|
BLAKE2b-256 | 85e2b688926b6484c31724668c12f41cb2c799d99cb1a393c471ade41f26cf46 |
Hashes for pdfo-2.2.0-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5157b1dcaf27023dae304958014df050f823196ed2c590e0a02e0c47580a259d |
|
MD5 | 1339275118eef248dbc1ad53bbb0154c |
|
BLAKE2b-256 | b3fe6a2a1608981c1ff7a843599849f04720c376f376b36c996e2f10a35bf66a |
Hashes for pdfo-2.2.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 309cf698971d376fff3b49c0046823a9979c87c4540776d786e1e7694b790142 |
|
MD5 | 729d87a0651d4b15f6e0a9fcc8581bc8 |
|
BLAKE2b-256 | 7ff1ce9bf16470b5e4cea5532a09ae97b0603a1a5a7ff868f97af380ff17be7e |
Hashes for pdfo-2.2.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2ceb08a583207c1a1c3b808c53bde1bfa7345759189a90a7cbbe743503391ac8 |
|
MD5 | d3193994d157e169476af5f2ae50515d |
|
BLAKE2b-256 | 859aa2f0b17fc828f9871cbbc7d6d1e4cb9296b5565b14e301f8bfae90991be3 |
Hashes for pdfo-2.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3991a6f080b77ec693e34efaa668ca5467c030d436a33bf2cbd7c7b4a0d41efb |
|
MD5 | 9a809fbed56f1f965d88364af1fc3d84 |
|
BLAKE2b-256 | 10801680aaceb81bf77ab4d69dd5ea77197c734644f0d5890faf63ca7fa75811 |
Hashes for pdfo-2.2.0-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f265f13c02543dcecee5688b9eb68d8ba6a5c50a77053e7de24784298321da3b |
|
MD5 | 37e8981f4f25f09f3afe76beb6308444 |
|
BLAKE2b-256 | 864a62e875f2d67cedb4f35735e26e2459efa49da6bfa62ad24db40b91aa2817 |
Hashes for pdfo-2.2.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d78ec1b0db8f1bff58ebf2833fbc0ac3e74c9be8e02a01111d6c9a321836e36 |
|
MD5 | a4cbf6d0388c0d8b9e546731d3d72113 |
|
BLAKE2b-256 | ee520094bf09b4724ad87bc03123a53c7fff4f7bf7b486d28924512da99dee6e |
Hashes for pdfo-2.2.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2ec9af16cf1cec14253f047189c7808b0b9b3f33fbd72a396a49d4cef26ca67 |
|
MD5 | 0933350df88fdc8675642dd86505c021 |
|
BLAKE2b-256 | 2b189c062f15522081847af72825b3194f3fa6140bd1453a594f50de8044077d |
Hashes for pdfo-2.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 58b599df1a8ab136843d11bcfda3910ee6642f508a22b91f16d40b03fe66b322 |
|
MD5 | 1668d7d20e4bf72ee69ffacd79120d35 |
|
BLAKE2b-256 | da964c05b06afb673f0757a3375fee5589f4e762a1b909af398e6cb17ffdf4f5 |
Hashes for pdfo-2.2.0-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e6b195f7593c17b2420f48bd4abe45f2d58f48eb6526b9b5748ce5aec3479c8 |
|
MD5 | bb34ee8c27122eb65cf18a3b9acaf7cf |
|
BLAKE2b-256 | a9c0f5adc340202f1f20eae26286d98630cef2c7f5a44e4d0a67590383992bc6 |
Hashes for pdfo-2.2.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f93bd97d088ae52d7c1d95fbc8cad8a79b4018e42267590ed72a6a8f5bdf5e5a |
|
MD5 | b9c158a7b355127b6ad39f2b3bc1dfbb |
|
BLAKE2b-256 | 9f5df531c90d3068254c6ebd138757b6ade93076fe8805f11696bd1e697f64f7 |
Hashes for pdfo-2.2.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ecec6d207d8569a4250d48f27f64f8382bbe10a92db783c322b1757c506757a4 |
|
MD5 | 1baf05d0babab828b7e483a4d6770a4e |
|
BLAKE2b-256 | 11d605952a905de7dee783cb8c1f43f7a3c9c0a9fe2452e230e2e33a5d2832c1 |
Hashes for pdfo-2.2.0-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fd303e96bac1b821caf23d8fa8cc5cff1d94c1862df31b9863048a2556d53f0 |
|
MD5 | ac72a16e58aae0e9f2db8d7c0b82d97f |
|
BLAKE2b-256 | 62f1020f30bba540dd9cae17b44ee2e0bbf970e314e926db7b7b8b6988b55a8a |