QuantLib: a free/open-source library for quantitative finance
fully annotated source code - version 1.34
|
#include <hybridsimulatedannealing.hpp>
Public Types | |
enum | LocalOptimizeScheme { NoLocalOptimize , EveryNewPoint , EveryBestPoint } |
enum | ResetScheme { NoResetScheme , ResetToBestPoint , ResetToOrigin } |
Public Member Functions | |
HybridSimulatedAnnealing (const Sampler &sampler, const Probability &probability, Temperature temperature, const Reannealing &reannealing=ReannealingTrivial(), Real startTemperature=200.0, Real endTemperature=0.01, Size reAnnealSteps=50, ResetScheme resetScheme=ResetToBestPoint, Size resetSteps=150, ext::shared_ptr< OptimizationMethod > localOptimizer=ext::shared_ptr< OptimizationMethod >(), LocalOptimizeScheme optimizeScheme=EveryBestPoint) | |
EndCriteria::Type | minimize (Problem &P, const EndCriteria &endCriteria) override |
minimize the optimization problem P More... | |
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 Attributes | |
Sampler | sampler_ |
Probability | probability_ |
Temperature | temperature_ |
Reannealing | reannealing_ |
Real | startTemperature_ |
Real | endTemperature_ |
Size | reAnnealSteps_ |
ResetScheme | resetScheme_ |
Size | resetSteps_ |
ext::shared_ptr< OptimizationMethod > | localOptimizer_ |
LocalOptimizeScheme | optimizeScheme_ |
Method is fairly straightforward: 1) Sampler provides a probability density (based on current value) for the parameters. Each iteration a new draw is made from it to find a new point 2) Probability determines whether the new point, obtained from Sampler, is accepted or not 3) Temperature is a schedule T(k) for the iteration k, which affects the Sampler and Probability 4) Reannealing is a departure from the traditional Boltzmann Annealing method: it rescales the iteration k independently for each dimension so as to improve convergence
The hybrid in the name is because one can provide it a local optimizer for use whenever any new best point is found or at every accepted point, in which case is used is chose by the user.
Class Sampler must implement the following interface:
Class Probability must implement the following interface:
Class Temperature must implement the following interface:
Class Reannealing must implement the following interface:
Definition at line 67 of file hybridsimulatedannealing.hpp.
enum LocalOptimizeScheme |
Enumerator | |
---|---|
NoLocalOptimize | |
EveryNewPoint | |
EveryBestPoint |
Definition at line 69 of file hybridsimulatedannealing.hpp.
enum ResetScheme |
Enumerator | |
---|---|
NoResetScheme | |
ResetToBestPoint | |
ResetToOrigin |
Definition at line 74 of file hybridsimulatedannealing.hpp.
HybridSimulatedAnnealing | ( | const Sampler & | sampler, |
const Probability & | probability, | ||
Temperature | temperature, | ||
const Reannealing & | reannealing = ReannealingTrivial() , |
||
Real | startTemperature = 200.0 , |
||
Real | endTemperature = 0.01 , |
||
Size | reAnnealSteps = 50 , |
||
ResetScheme | resetScheme = ResetToBestPoint , |
||
Size | resetSteps = 150 , |
||
ext::shared_ptr< OptimizationMethod > | localOptimizer = ext::shared_ptr<OptimizationMethod>() , |
||
LocalOptimizeScheme | optimizeScheme = EveryBestPoint |
||
) |
Definition at line 80 of file hybridsimulatedannealing.hpp.
|
overridevirtual |
minimize the optimization problem P
Implements OptimizationMethod.
Definition at line 120 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 106 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 107 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 108 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 109 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 110 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 111 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 112 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 113 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 114 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 115 of file hybridsimulatedannealing.hpp.
|
private |
Definition at line 116 of file hybridsimulatedannealing.hpp.