QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Simplex Class Reference

Multi-dimensional simplex class. More...

#include <simplex.hpp>

+ Inheritance diagram for Simplex:
+ Collaboration diagram for Simplex:

Public Member Functions

 Simplex (Real lambda)
 
EndCriteria::Type minimize (Problem &P, const EndCriteria &endCriteria) override
 minimize the optimization problem P More...
 
Real lambda () const
 
- Public Member Functions inherited from OptimizationMethod
virtual ~OptimizationMethod ()=default
 
virtual EndCriteria::Type minimize (Problem &P, const EndCriteria &endCriteria)=0
 minimize the optimization problem P More...
 

Private Member Functions

Real extrapolate (Problem &P, Size iHighest, Real &factor) const
 

Private Attributes

Real lambda_
 
std::vector< Arrayvertices_
 
Array values_
 
Array sum_
 

Detailed Description

Multi-dimensional simplex class.

This method is rather raw and requires quite a lot of computing resources, but it has the advantage that it does not need any evaluation of the cost function's gradient, and that it is quite easily implemented. First, we choose N+1 starting points, given here by a starting point \( \mathbf{P}_{0} \) and N points such that

\[ \mathbf{P}_{\mathbf{i}}=\mathbf{P}_{0}+\lambda \mathbf{e}_{\mathbf{i}}, \]

where \( \lambda \) is the problem's characteristic length scale). These points will form a geometrical form called simplex. The principle of the downhill simplex method is, at each iteration, to move the worst point (highest cost function value) through the opposite face to a better point. When the simplex seems to be constrained in a valley, it will be contracted downhill, keeping the best point unchanged.

Definition at line 58 of file simplex.hpp.

Constructor & Destructor Documentation

◆ Simplex()

Simplex ( Real  lambda)

Constructor taking as input the characteristic length

Definition at line 61 of file simplex.hpp.

Member Function Documentation

◆ minimize()

EndCriteria::Type minimize ( Problem P,
const EndCriteria endCriteria 
)
overridevirtual

minimize the optimization problem P

Implements OptimizationMethod.

Definition at line 96 of file simplex.cpp.

+ Here is the call graph for this function:

◆ lambda()

Real lambda ( ) const

Definition at line 63 of file simplex.hpp.

◆ extrapolate()

Real extrapolate ( Problem P,
Size  iHighest,
Real factor 
) const
private

Definition at line 58 of file simplex.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ lambda_

Real lambda_
private

Definition at line 69 of file simplex.hpp.

◆ vertices_

std::vector<Array> vertices_
mutableprivate

Definition at line 70 of file simplex.hpp.

◆ values_

Array values_
mutableprivate

Definition at line 71 of file simplex.hpp.

◆ sum_

Array sum_
private

Definition at line 71 of file simplex.hpp.