Skip to main content

Nelder-Mead for numerical optimization in Python

Project description

# neldermead

Nelder-Mead implementation


## Getting Started

### Prerequisites

You need only [NumPy]( that is the package for scientific computing.

### Installing

Please run the following command.

$ pip install neldermead

## Example

This is a simple example that objective function is sphere function.

import numpy as np
from neldermead import NelderMead

dim = 3
f = lambda x: np.sum(x**2)
simplex = np.zeros([dim, dim + 1])
for i in range(dim + 1):
simplex[:, i] = np.array([np.random.rand() for _ in range(dim)])
nm = NelderMead(dim, f, simplex)

x_best, f_best = nm.optimize(100)
print("x_best:{}, f_best:{}".format(x_best, f_best))
# [-1.80962770e-08]
# [ 5.08040874e-08]], f_best:3.1277043680572982e-15

## Versioning

We use [SemVer]( for versioning. For the versions available, see the [tags on this repository](

## License

This project is licensed under the MIT License - see the [LICENSE]( file for details

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for neldermead, version 0.0.12
Filename, size File type Python version Upload date Hashes
Filename, size neldermead-0.0.12-py3-none-any.whl (3.3 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size neldermead-0.0.12.tar.gz (3.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page