Mantid
|
FABADA : Implements the FABADA Algorithm, based on a Adaptive Metropolis Algorithm extended with Gibbs Sampling. More...
#include <FABADAMinimizer.h>
Public Member Functions | |
void | boundApplication (const size_t ¶meterIndex, double &newValue, double &step) |
Public methods only for testing purposes. More... | |
double | costFunctionVal () override |
Return current value of the cost function. More... | |
FABADAMinimizer () | |
Constructor. More... | |
void | finalize () override |
Finalize minimization, eg store additional outputs. More... | |
void | initialize (API::ICostFunction_sptr function, size_t maxIterations) override |
Initialize minimizer, i.e. pass a function to minimize. More... | |
bool | iterate (size_t iter) override |
Do one iteration. More... | |
std::string | name () const override |
Name of the minimizer. More... | |
Public Member Functions inherited from Mantid::API::IFuncMinimizer | |
virtual double | costFunctionVal ()=0 |
Get value of cost function. More... | |
virtual void | finalize () |
Finalize minimization, eg store additional outputs. More... | |
virtual std::string | getError () const |
Get the error string. More... | |
virtual void | initialize (API::ICostFunction_sptr function, size_t maxIterations=1000)=0 |
Initialize minimizer. More... | |
virtual bool | iterate (size_t iteration)=0 |
Do one iteration. More... | |
virtual bool | minimize (size_t maxIterations=1000) |
Perform iteration with minimizer and return true if successful. More... | |
virtual std::string | name () const =0 |
Get name of minimizer. More... | |
Public Member Functions inherited from Mantid::Kernel::PropertyManager | |
::Json::Value | asJson (bool withDefaultValues=false) const override |
Return the property manager serialized as a json object. More... | |
std::string | asString (bool withDefaultValues=false) const override |
Return the property manager serialized as a string. More... | |
void | clear () override |
Clears the whole property map. More... | |
void | declareOrReplaceProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
Add or replace a property in the list of managed properties. More... | |
void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). More... | |
void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
Add a property of string type to the list of managed properties. More... | |
void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
Add a property to the list of managed properties with no validator. More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, const unsigned int direction) |
Add a property of the template type to the list of managed properties. More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
Add a property of the template type to the list of managed properties. More... | |
void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="") override |
Add a property to the list of managed properties. More... | |
virtual void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="")=0 |
Function to declare properties (i.e. store them) More... | |
bool | existsProperty (const std::string &name) const override |
Checks whether the named property is already in the list of managed property. More... | |
void | filterByProperty (const TimeSeriesProperty< bool > &filter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >()) override |
Filter the managed properties by the given boolean property mask. More... | |
void | filterByTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &stop) override |
Filter out a run by time. More... | |
std::vector< std::string > | getDeclaredPropertyNames () const noexcept override |
Return the list of declared property names. More... | |
Property * | getPointerToProperty (const std::string &name) const override |
Get a property by name. More... | |
const std::vector< Property * > & | getProperties () const override |
Get the list of managed properties. More... | |
TypedValue | getProperty (const std::string &name) const override |
Get the value of a property. More... | |
std::string | getPropertyValue (const std::string &name) const override |
Get the value of a property as a string. More... | |
bool | operator!= (const PropertyManager &other) const |
PropertyManager & | operator+= (const PropertyManager &rhs) |
Addition operator. More... | |
PropertyManager & | operator= (const PropertyManager &) |
Assignment operator - performs a deep copy. More... | |
bool | operator== (const PropertyManager &other) const |
size_t | propertyCount () const override |
Count the number of properties under management. More... | |
PropertyManager () | |
Default constructor. More... | |
PropertyManager (const PropertyManager &) | |
copy constructor More... | |
void | removeProperty (const std::string &name, const bool delproperty=true) override |
removes the property from properties map More... | |
void | resetProperties () override |
Reset property values back to initial values (blank or default values) More... | |
void | setProperties (const ::Json::Value &jsonValue, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
Set the ordered list of properties by a json value collection. More... | |
void | setProperties (const ::Json::Value &jsonValue, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) |
Set the ordered list of properties by a json value collection. More... | |
void | setProperties (const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false) override |
Set the ordered list of properties by one string of values, separated by semicolons. More... | |
void | setProperties (const std::string &propertiesJson, IPropertyManager *targetPropertyManager, const std::unordered_set< std::string > &ignoreProperties, bool createMissing=false) |
Set the ordered list of properties by one string of values, separated by semicolons. More... | |
void | setPropertiesWithString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >()) override |
Sets all the declared properties from a string. More... | |
void | setPropertyOrdinal (const int &index, const std::string &value) override |
Set the value of a property by an index N.B. More... | |
void | setPropertyValue (const std::string &name, const std::string &value) override |
Set the value of a property by string N.B. More... | |
void | setPropertyValueFromJson (const std::string &name, const Json::Value &value) override |
Set the value of a property by Json::Value. More... | |
void | splitByTime (std::vector< SplittingInterval > &splitter, std::vector< PropertyManager * > outputs) const override |
Split a run by time (splits the TimeSeriesProperties contained). More... | |
std::unique_ptr< Property > | takeProperty (const size_t index) override |
removes the property from the properties map and returns a pointer to it More... | |
bool | validateProperties () const override |
Validates all the properties in the collection. More... | |
virtual | ~PropertyManager () override |
Virtual destructor. More... | |
Public Member Functions inherited from Mantid::Kernel::IPropertyManager | |
virtual ::Json::Value | asJson (bool withDefaultValues=false) const =0 |
Return the property manager serialized as a json object. More... | |
virtual std::string | asString (bool withDefaultValues=false) const =0 |
Return the property manager serialized as a string. More... | |
virtual void | declareOrReplaceProperty (std::unique_ptr< Property > p, const std::string &doc="")=0 |
Function to declare properties (i.e. store them) More... | |
void | declareProperty (const std::string &name, const char *value, const std::string &doc, IValidator_sptr validator=std::make_shared< NullValidator >(), const unsigned int direction=Direction::Input) |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). More... | |
void | declareProperty (const std::string &name, const char *value, const unsigned int direction) |
Add a property of string type to the list of managed properties. More... | |
void | declareProperty (const std::string &name, const char *value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc=std::string(), const unsigned int direction=Direction::Input) |
Specialised version of declareProperty template method to prevent the creation of a PropertyWithValue of type const char* if an argument in quotes is passed (it will be converted to a string). More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, const std::string &doc, const unsigned int direction=Direction::Input) |
Add a property to the list of managed properties with no validator. More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, const unsigned int direction) |
Add a property of the template type to the list of managed properties. More... | |
template<typename T > | |
void | declareProperty (const std::string &name, T value, IValidator_sptr validator=std::make_shared< NullValidator >(), const std::string &doc="", const unsigned int direction=Direction::Input) |
Add a property of the template type to the list of managed properties. More... | |
virtual void | declareProperty (std::unique_ptr< Property > p, const std::string &doc="")=0 |
Function to declare properties (i.e. store them) More... | |
virtual bool | existsProperty (const std::string &name) const =0 |
Checks whether the named property is already in the list of managed property. More... | |
virtual void | filterByProperty (const TimeSeriesProperty< bool > &, const std::vector< std::string > &)=0 |
virtual void | filterByTime (const Types::Core::DateAndTime &, const Types::Core::DateAndTime &)=0 |
virtual std::vector< std::string > | getDeclaredPropertyNames () const noexcept=0 |
Get the list of managed property names. More... | |
virtual Property * | getPointerToProperty (const std::string &name) const =0 |
Get a pointer to property by name. More... | |
virtual const std::vector< Property * > & | getProperties () const =0 |
Get the list of managed properties. More... | |
std::vector< Property * > | getPropertiesInGroup (const std::string &group) const |
Get the list of managed properties in a given group. More... | |
virtual TypedValue | getProperty (const std::string &name) const =0 |
Get the value of a property. More... | |
virtual std::string | getPropertyValue (const std::string &name) const =0 |
Get the value of a property as a string. More... | |
virtual size_t | propertyCount () const =0 |
Returns the number of properties under management. More... | |
virtual void | removeProperty (const std::string &name, const bool delproperty=true)=0 |
Removes the property from management. More... | |
virtual void | resetProperties ()=0 |
virtual void | setProperties (const ::Json::Value &jsonValue, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false)=0 |
Sets all the properties from a json object. More... | |
virtual void | setProperties (const std::string &propertiesJson, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >(), bool createMissing=false)=0 |
Sets all properties from a string. More... | |
virtual void | setPropertiesWithString (const std::string &propertiesString, const std::unordered_set< std::string > &ignoreProperties=std::unordered_set< std::string >())=0 |
Sets all the declared properties from a string. More... | |
IPropertyManager * | setProperty (const std::string &name, const char *value) |
Specialised version of setProperty template method to handle const char *. More... | |
IPropertyManager * | setProperty (const std::string &name, const std::string &value) |
Specialised version of setProperty template method to handle std::string. More... | |
template<typename T > | |
IPropertyManager * | setProperty (const std::string &name, const T &value) |
Templated method to set the value of a PropertyWithValue. More... | |
template<typename T > | |
IPropertyManager * | setProperty (const std::string &name, std::unique_ptr< T > value) |
Templated method to set the value of a PropertyWithValue from a std::unique_ptr. More... | |
void | setPropertyGroup (const std::string &name, const std::string &group) |
Set the group for a given property. More... | |
virtual void | setPropertyOrdinal (const int &index, const std::string &value)=0 |
Set the value of a property by an index. More... | |
void | setPropertySettings (const std::string &name, std::unique_ptr< IPropertySettings > settings) |
virtual void | setPropertyValue (const std::string &name, const std::string &value)=0 |
Sets property value from a string. More... | |
virtual void | setPropertyValueFromJson (const std::string &name, const Json::Value &value)=0 |
Sets property value from a Json::Value. More... | |
virtual void | splitByTime (std::vector< SplittingInterval > &, std::vector< PropertyManager * >) const =0 |
virtual std::unique_ptr< Property > | takeProperty (const size_t index)=0 |
Removes the property from management and returns a pointer to it. More... | |
void | updatePropertyValues (const IPropertyManager &other) |
Update values of the existing properties. More... | |
virtual bool | validateProperties () const =0 |
Validates all the properties in the collection. More... | |
virtual | ~IPropertyManager ()=default |
Private Member Functions | |
void | algorithmDisplacement (const size_t ¶meterIndex, const double &chi2New, const EigenVector &newParameters) |
Given the new chi2, next position is calculated and updated. More... | |
void | calculateConvChainAndBestParameters (size_t convLength, int nSteps, std::vector< std::vector< double > > &reducedChain, std::vector< double > &bestParameters, std::vector< double > &errorLeft, std::vector< double > &errorRight) |
Calculated converged chain and parameters. More... | |
void | convergenceCheck () |
Check for convergence (including Overexploration convergence), updates m_converged. More... | |
double | gaussianStep (const double &jump) |
Returns the step from a Gaussian given sigma = Jump. More... | |
double | getMostProbableChiSquared (std::size_t const &convLength, std::vector< std::vector< double > > &reducedChain, int const &pdfLength, std::vector< double > &xValues, std::vector< double > &yValues, std::vector< double > &PDFYAxis, double const &start, double const &bin) |
Finds the most probable Chi Squared value. More... | |
void | initChainsAndParameters () |
Initialize member variables related to fitting parameters. More... | |
void | initSimulatedAnnealing () |
Initialize member variables related to simulated annealing. More... | |
bool | iterationContinuation () |
Decides wheather iteration must continue or not. More... | |
void | jumpUpdate (const size_t ¶meterIndex) |
Updates the ParameterIndex-th parameter jump if appropriate. More... | |
void | outputChains () |
Output Markov chains. More... | |
void | outputConvergedChains (size_t convLength, int nSteps) |
Output converged chains. More... | |
void | outputCostFunctionTable (size_t convLength, double mostProbableChi2) |
Output cost function. More... | |
void | outputParameterTable (const std::vector< double > &bestParameters, const std::vector< double > &errorsLeft, const std::vector< double > &errorsRight) |
Output parameter table. More... | |
double | outputPDF (std::size_t const &convLength, std::vector< std::vector< double > > &reducedChain) |
Output PDF. More... | |
void | outputPDF (std::vector< double > &xValues, std::vector< double > &yValues, std::vector< std::vector< double > > &reducedChain, std::size_t const &convLength, int const &pdfLength) |
void | setParameterXAndYValuesForPDF (std::vector< double > &xValues, std::vector< double > &yValues, std::vector< std::vector< double > > &reducedChain, std::size_t const &convLength, int const &pdfLength) |
Computes the X and Y for the Parameter PDF's. More... | |
void | simAnnealingRefrigeration () |
Refrigerates the system if appropriate. More... | |
void | tieApplication (const size_t ¶meterIndex, EigenVector &newParameters, double &newValue) |
Applied to the other parameters first and sequentially, finally to the current one. More... | |
Private Attributes | |
std::vector< std::vector< double > > | m_chain |
Markov chain. More... | |
size_t | m_chainIterations |
The number of chain iterations. More... | |
std::vector< int > | m_changes |
The number of changes done on each parameter. More... | |
std::vector< int > | m_changesOld |
To track convergence through immobility. More... | |
double | m_chi2 |
The chi square result of previous iteration;. More... | |
bool | m_converged |
Boolean that indicates global convergence. More... | |
size_t | m_convPoint |
The point when convergence has been reached. More... | |
size_t | m_counter |
The number of iterations done (restarted at each phase). More... | |
size_t | m_counterGlobal |
The global number of iterations done. More... | |
std::vector< double > | m_criteria |
Convergence criteria for each parameter. More... | |
API::IFunction_sptr | m_fitFunction |
Pointer to the Fitting Function (IFunction) inside the cost function. More... | |
std::vector< double > | m_jump |
The jump for each parameter. More... | |
std::shared_ptr< CostFunctions::CostFuncLeastSquares > | m_leastSquares |
Pointer to the cost function. Must be the least squares. More... | |
size_t | m_leftRefrPoints |
The number of refrigeration points left. More... | |
size_t | m_maxIter |
Maximum number of iterations. More... | |
size_t | m_nParams |
Number of parameters of the FittingFunction (not necessarily the CostFunction) More... | |
std::vector< size_t > | m_numInactiveRegenerations |
Number of consecutive regenerations without changes. More... | |
bool | m_overexploration |
Overexploration applied. More... | |
EigenVector | m_parameters |
Parameters' values. More... | |
std::vector< bool > | m_parChanged |
Bool that idicates if a varible has changed at some self iteration. More... | |
std::vector< bool > | m_parConverged |
Convergence of each parameter. More... | |
size_t | m_simAnnealingItStep |
Number of iterations between Simulated Annealing refrigeration points. More... | |
double | m_temperature |
Simulated Annealing temperature. More... | |
double | m_tempStep |
Temperature step between different Simulated Annealing phases. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from Mantid::Kernel::PropertyManager | |
static std::string | getInvalidValuesFilterLogName (const std::string &logName) |
Gets the correct log name for the matching invalid values log for a given log name. More... | |
static std::string | getLogNameFromInvalidValuesFilter (const std::string &logName) |
static bool | isAnInvalidValuesFilterLog (const std::string &logName) |
Static Public Attributes inherited from Mantid::Kernel::PropertyManager | |
static const std::string | INVALID_VALUES_SUFFIX = "_invalid_values" |
Protected Member Functions inherited from Mantid::Kernel::PropertyManager | |
Property * | getPointerToPropertyOrdinal (const int &index) const override |
Get a property by an index. More... | |
Property * | getPointerToPropertyOrNull (const std::string &name) const |
Get a property by name. More... | |
Protected Member Functions inherited from Mantid::Kernel::IPropertyManager | |
virtual void | afterPropertySet (const std::string &) |
Override this method to perform a custom action right after a property was set. More... | |
virtual void | clear ()=0 |
Clears all properties under management. More... | |
virtual Property * | getPointerToPropertyOrdinal (const int &index) const =0 |
Get a property by an index. More... | |
template<typename T > | |
T | getValue (const std::string &name) const |
Templated method to get the value of a property. More... | |
template<> | |
MANTID_KERNEL_DLL PropertyManager_sptr | getValue (const std::string &name) const |
template<> | |
MANTID_KERNEL_DLL PropertyManager_const_sptr | getValue (const std::string &name) const |
Protected Attributes inherited from Mantid::API::IFuncMinimizer | |
std::string | m_errorString |
Error string. More... | |
FABADA : Implements the FABADA Algorithm, based on a Adaptive Metropolis Algorithm extended with Gibbs Sampling.
Designed to obtain the Bayesian posterior PDFs
Definition at line 32 of file FABADAMinimizer.h.
Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::FABADAMinimizer | ( | ) |
Constructor.
Definition at line 79 of file FABADAMinimizer.cpp.
References Mantid::API::PropertyMode::Optional, and Mantid::Kernel::Direction::Output.
|
private |
Given the new chi2, next position is calculated and updated.
m_changes[ParameterIndex] updated too
parameterIndex | :: the index of the parameter |
chi2New | :: the new value of chi2 |
newParameters | :: new value of the fitting parameters |
Definition at line 457 of file FABADAMinimizer.cpp.
References Mantid::CurveFitting::EigenVector::get(), m_chain, m_changes, m_chi2, m_fitFunction, m_leastSquares, m_nParams, m_parameters, and m_temperature.
Referenced by iterate().
void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::boundApplication | ( | const size_t & | parameterIndex, |
double & | newValue, | ||
double & | step | ||
) |
Public methods only for testing purposes.
If the new point is out of its bounds, it is changed to fit in the bound limits.
If the new point is out of its bounds, it is changed to fit in the bound limits
parameterIndex | :: the index of the parameter |
newValue | :: the value of the parameter |
step | :: the step used to modify the parameter value |
Definition at line 373 of file FABADAMinimizer.cpp.
References Mantid::Kernel::delta, Mantid::CurveFitting::EigenVector::get(), lower, m_fitFunction, m_jump, m_parameters, and upper.
Referenced by iterate().
|
private |
Calculated converged chain and parameters.
Create the reduced convergence chain and calculate the best parameter values and errors.
convLength | :: length of the converged chain |
nSteps | :: number of steps done between chain points to avoid |
reducedChain | :: [output] the reduced chain |
bestParameters | :: [output] vector containing best values for fitting parameters |
errorLeft | :: [output] vector containing the sqrt of the mean square left deviation |
errorRight | :: [output] vector containing the sqrt of the mean square right deviation |
Definition at line 917 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, m_chain, m_chi2, m_convPoint, m_nParams, and Mantid::Kernel::Logger::warning().
Referenced by finalize().
|
private |
Check for convergence (including Overexploration convergence), updates m_converged.
Check if Chi square has converged for all the parameters if overexploring or Simulated Annealing completed.
Definition at line 557 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, Mantid::Kernel::PropertyManager::getProperty(), m_chainIterations, m_changes, m_converged, m_convPoint, m_counter, m_counterGlobal, m_leftRefrPoints, m_maxIter, m_nParams, m_numInactiveRegenerations, m_parConverged, m_temperature, and Mantid::Kernel::Logger::warning().
Referenced by iterate().
|
overridevirtual |
Return current value of the cost function.
Implements Mantid::API::IFuncMinimizer.
Definition at line 289 of file FABADAMinimizer.cpp.
References m_chi2.
|
overridevirtual |
Finalize minimization, eg store additional outputs.
When all the iterations have been done, calculate and show all the results.
Reimplemented from Mantid::API::IFuncMinimizer.
Definition at line 294 of file FABADAMinimizer.cpp.
References calculateConvChainAndBestParameters(), Mantid::API::g_log, Mantid::Kernel::PropertyManager::getProperty(), Mantid::Kernel::PropertyManager::getPropertyValue(), m_fitFunction, m_leastSquares, m_nParams, outputChains(), outputConvergedChains(), outputCostFunctionTable(), outputParameterTable(), outputPDF(), and Mantid::Kernel::Logger::warning().
|
private |
Returns the step from a Gaussian given sigma = Jump.
Returns the step from a Gaussian given sigma = jump.
jump | :: sigma |
Definition at line 362 of file FABADAMinimizer.cpp.
Referenced by iterate().
|
private |
Finds the most probable Chi Squared value.
Definition at line 825 of file FABADAMinimizer.cpp.
References m_nParams.
Referenced by outputPDF().
|
private |
Initialize member variables related to fitting parameters.
Initialze member variables related to fitting parameters.
Definition at line 982 of file FABADAMinimizer.cpp.
References Mantid::Kernel::PropertyManager::getProperty(), lower, m_chain, m_chainIterations, m_changes, m_changesOld, m_chi2, m_criteria, m_fitFunction, m_jump, m_leastSquares, m_nParams, m_numInactiveRegenerations, m_parameters, m_parChanged, m_parConverged, n, Mantid::CurveFitting::EigenVector::resize(), Mantid::CurveFitting::EigenVector::set(), and Mantid::CurveFitting::EigenVector::size().
Referenced by initialize().
|
overridevirtual |
Initialize minimizer, i.e. pass a function to minimize.
Initialize minimizer.
Set initial values for all private members
function | :: the fit function |
maxIterations | :: maximum number of iterations |
Implements Mantid::API::IFuncMinimizer.
Definition at line 136 of file FABADAMinimizer.cpp.
References initChainsAndParameters(), initSimulatedAnnealing(), m_chainIterations, m_converged, m_counter, m_counterGlobal, m_fitFunction, m_leastSquares, m_leftRefrPoints, m_maxIter, m_overexploration, and m_simAnnealingItStep.
|
private |
Initialize member variables related to simulated annealing.
Initialize member variables used for simulated annealing.
Definition at line 1035 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, Mantid::Kernel::PropertyManager::getProperty(), m_leftRefrPoints, m_overexploration, m_simAnnealingItStep, m_temperature, m_tempStep, and Mantid::Kernel::Logger::warning().
Referenced by initialize().
|
overridevirtual |
Do one iteration.
Implements Mantid::API::IFuncMinimizer.
Definition at line 178 of file FABADAMinimizer.cpp.
References algorithmDisplacement(), boundApplication(), convergenceCheck(), fabs, gaussianStep(), Mantid::CurveFitting::EigenVector::get(), Mantid::Kernel::PropertyManager::getProperty(), iterationContinuation(), jumpUpdate(), Mantid::Geometry::m, m_chainIterations, m_chi2, m_converged, m_counter, m_counterGlobal, m_criteria, m_fitFunction, m_jump, m_leastSquares, m_leftRefrPoints, m_nParams, m_parameters, m_parChanged, m_parConverged, m_simAnnealingItStep, Mantid::CurveFitting::EigenVector::set(), simAnnealingRefrigeration(), and tieApplication().
|
private |
Decides wheather iteration must continue or not.
Definition at line 633 of file FABADAMinimizer.cpp.
References m_chainIterations, m_converged, m_counter, m_counterGlobal, m_fitFunction, m_leftRefrPoints, m_maxIter, m_nParams, m_parConverged, and std::to_string().
Referenced by iterate().
|
private |
Updates the ParameterIndex-th parameter jump if appropriate.
Updates the parameterIndex-th parameter jump if appropriate.
parameterIndex | :: the index of the current parameter |
Definition at line 512 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, Mantid::Kernel::PropertyManager::getProperty(), m_changes, m_changesOld, m_counter, m_fitFunction, m_jump, m_leftRefrPoints, m_numInactiveRegenerations, and Mantid::Kernel::Logger::warning().
Referenced by iterate(), and simAnnealingRefrigeration().
|
inlineoverridevirtual |
Name of the minimizer.
Implements Mantid::API::IFuncMinimizer.
Definition at line 37 of file FABADAMinimizer.h.
|
private |
Output Markov chains.
Create the workspace for the complete parameters chain (the last histogram is for the Chi square).
Definition at line 674 of file FABADAMinimizer.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_chain, m_nParams, Mantid::Kernel::IPropertyManager::setProperty(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by finalize().
|
private |
Output converged chains.
Create the workspace containing the converged chain.
convLength | :: length of the converged chain |
nSteps | :: number of steps done between chain points to avoid correlation |
Definition at line 700 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, Mantid::Kernel::SingletonHolder< T >::Instance(), m_chain, m_convPoint, m_nParams, Mantid::Kernel::IPropertyManager::setProperty(), Mantid::Kernel::Logger::warning(), Mantid::Geometry::X, and Mantid::Geometry::Y.
Referenced by finalize().
|
private |
Output cost function.
Create the workspace containing chi2 values.
convLength | :: length of the converged chain |
mostProbableChi2 | :: most probable chi2 value correlation |
Definition at line 734 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, Mantid::Kernel::SingletonHolder< T >::Instance(), m_chi2, m_leastSquares, m_nParams, Mantid::Kernel::IPropertyManager::setProperty(), and Mantid::Kernel::Logger::warning().
Referenced by finalize().
|
private |
Output parameter table.
Create the table workspace containing parameter values.
bestParameters | :: vector containing best values for fitting parameters |
errorLeft | :: [output] vector containing the sqrt of the mean square left deviation |
errorRight | :: [output] vector containing the sqrt of the mean square right deviation |
Definition at line 885 of file FABADAMinimizer.cpp.
References Mantid::Kernel::SingletonHolder< T >::Instance(), m_fitFunction, m_nParams, and Mantid::Kernel::IPropertyManager::setProperty().
Referenced by finalize().
|
private |
Output PDF.
Create the workspace containing probability density function (PDF)
convLength | :: length of the converged chain |
reducedChain | :: the reduced chain (will be sorted) |
Definition at line 770 of file FABADAMinimizer.cpp.
References Mantid::API::g_log, getMostProbableChiSquared(), Mantid::Kernel::PropertyManager::getProperty(), m_nParams, outputPDF(), and Mantid::Kernel::Logger::warning().
Referenced by finalize(), and outputPDF().
|
private |
Definition at line 806 of file FABADAMinimizer.cpp.
References Mantid::API::WorkspaceGroup::addWorkspace(), Mantid::API::createWorkspace(), Mantid::Kernel::SingletonHolder< T >::Instance(), m_fitFunction, m_nParams, setParameterXAndYValuesForPDF(), and workspace.
|
private |
Computes the X and Y for the Parameter PDF's.
Definition at line 851 of file FABADAMinimizer.cpp.
References m_nParams.
Referenced by outputPDF().
|
private |
Refrigerates the system if appropriate.
Definition at line 610 of file FABADAMinimizer.cpp.
References jumpUpdate(), m_changes, m_counter, m_leftRefrPoints, m_nParams, m_temperature, and m_tempStep.
Referenced by iterate().
|
private |
Applied to the other parameters first and sequentially, finally to the current one.
Applies ties to parameters.
Ties are applied to other parameters first and sequentially, finally ties are applied to the current parameter
parameterIndex | :: the index of the parameter |
newParameters | :: the value of the parameters after applying ties |
newValue | :: new value of the current parameter |
Definition at line 414 of file FABADAMinimizer.cpp.
References Mantid::API::ParameterTie::eval(), m_fitFunction, m_leastSquares, m_nParams, and Mantid::CurveFitting::EigenVector::set().
Referenced by iterate().
|
private |
Markov chain.
Definition at line 120 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), calculateConvChainAndBestParameters(), initChainsAndParameters(), outputChains(), and outputConvergedChains().
|
private |
The number of chain iterations.
Definition at line 112 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initChainsAndParameters(), initialize(), iterate(), and iterationContinuation().
|
private |
The number of changes done on each parameter.
Definition at line 114 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), convergenceCheck(), initChainsAndParameters(), jumpUpdate(), and simAnnealingRefrigeration().
|
private |
To track convergence through immobility.
Definition at line 153 of file FABADAMinimizer.h.
Referenced by initChainsAndParameters(), and jumpUpdate().
|
private |
The chi square result of previous iteration;.
Definition at line 122 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), calculateConvChainAndBestParameters(), costFunctionVal(), initChainsAndParameters(), iterate(), and outputCostFunctionTable().
|
private |
Boolean that indicates global convergence.
Definition at line 124 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initialize(), iterate(), and iterationContinuation().
|
private |
The point when convergence has been reached.
Definition at line 126 of file FABADAMinimizer.h.
Referenced by calculateConvChainAndBestParameters(), convergenceCheck(), and outputConvergedChains().
|
private |
The number of iterations done (restarted at each phase).
Definition at line 110 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initialize(), iterate(), iterationContinuation(), jumpUpdate(), and simAnnealingRefrigeration().
|
private |
The global number of iterations done.
Definition at line 138 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initialize(), iterate(), and iterationContinuation().
|
private |
Convergence criteria for each parameter.
Definition at line 130 of file FABADAMinimizer.h.
Referenced by initChainsAndParameters(), and iterate().
|
private |
Pointer to the Fitting Function (IFunction) inside the cost function.
Definition at line 108 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), boundApplication(), finalize(), initChainsAndParameters(), initialize(), iterate(), iterationContinuation(), jumpUpdate(), outputParameterTable(), outputPDF(), and tieApplication().
|
private |
The jump for each parameter.
Definition at line 116 of file FABADAMinimizer.h.
Referenced by boundApplication(), initChainsAndParameters(), iterate(), and jumpUpdate().
|
private |
Pointer to the cost function. Must be the least squares.
Definition at line 106 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), finalize(), initChainsAndParameters(), initialize(), iterate(), outputCostFunctionTable(), and tieApplication().
|
private |
The number of refrigeration points left.
Definition at line 142 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initialize(), initSimulatedAnnealing(), iterate(), iterationContinuation(), jumpUpdate(), and simAnnealingRefrigeration().
|
private |
Maximum number of iterations.
Definition at line 132 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initialize(), and iterationContinuation().
|
private |
Number of parameters of the FittingFunction (not necessarily the CostFunction)
Definition at line 149 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), calculateConvChainAndBestParameters(), convergenceCheck(), finalize(), getMostProbableChiSquared(), initChainsAndParameters(), iterate(), iterationContinuation(), outputChains(), outputConvergedChains(), outputCostFunctionTable(), outputParameterTable(), outputPDF(), setParameterXAndYValuesForPDF(), simAnnealingRefrigeration(), and tieApplication().
|
private |
Number of consecutive regenerations without changes.
Definition at line 151 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initChainsAndParameters(), and jumpUpdate().
|
private |
Overexploration applied.
Definition at line 146 of file FABADAMinimizer.h.
Referenced by initialize(), and initSimulatedAnnealing().
|
private |
Parameters' values.
Definition at line 118 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), boundApplication(), initChainsAndParameters(), and iterate().
|
private |
Bool that idicates if a varible has changed at some self iteration.
Definition at line 134 of file FABADAMinimizer.h.
Referenced by initChainsAndParameters(), and iterate().
|
private |
Convergence of each parameter.
Definition at line 128 of file FABADAMinimizer.h.
Referenced by convergenceCheck(), initChainsAndParameters(), iterate(), and iterationContinuation().
|
private |
Number of iterations between Simulated Annealing refrigeration points.
Definition at line 140 of file FABADAMinimizer.h.
Referenced by initialize(), initSimulatedAnnealing(), and iterate().
|
private |
Simulated Annealing temperature.
Definition at line 136 of file FABADAMinimizer.h.
Referenced by algorithmDisplacement(), convergenceCheck(), initSimulatedAnnealing(), and simAnnealingRefrigeration().
|
private |
Temperature step between different Simulated Annealing phases.
Definition at line 144 of file FABADAMinimizer.h.
Referenced by initSimulatedAnnealing(), and simAnnealingRefrigeration().