Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer Class Reference

FABADA : Implements the FABADA Algorithm, based on a Adaptive Metropolis Algorithm extended with Gibbs Sampling. More...

#include <FABADAMinimizer.h>

Inheritance diagram for Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer:
Mantid::API::IFuncMinimizer Mantid::Kernel::PropertyManager Mantid::Kernel::IPropertyManager

Public Member Functions

void boundApplication (const size_t &parameterIndex, 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...
 
PropertygetPointerToProperty (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
 
PropertyManageroperator+= (const PropertyManager &rhs)
 Addition operator. More...
 
PropertyManageroperator= (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< PropertytakeProperty (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 PropertygetPointerToProperty (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...
 
IPropertyManagersetProperty (const std::string &name, const char *value)
 Specialised version of setProperty template method to handle const char *. More...
 
IPropertyManagersetProperty (const std::string &name, const std::string &value)
 Specialised version of setProperty template method to handle std::string. More...
 
template<typename T >
IPropertyManagersetProperty (const std::string &name, const T &value)
 Templated method to set the value of a PropertyWithValue. More...
 
template<typename T >
IPropertyManagersetProperty (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< PropertytakeProperty (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 &parameterIndex, 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 &parameterIndex)
 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 &parameterIndex, 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::CostFuncLeastSquaresm_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
PropertygetPointerToPropertyOrdinal (const int &index) const override
 Get a property by an index. More...
 
PropertygetPointerToPropertyOrNull (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 PropertygetPointerToPropertyOrdinal (const int &index) const =0
 Get a property by an index. More...
 
template<typename 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...
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ FABADAMinimizer()

Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::FABADAMinimizer ( )

Constructor.

Definition at line 79 of file FABADAMinimizer.cpp.

References Mantid::API::PropertyMode::Optional, and Mantid::Kernel::Direction::Output.

Member Function Documentation

◆ algorithmDisplacement()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::algorithmDisplacement ( const size_t &  parameterIndex,
const double &  chi2New,
const EigenVector newParameters 
)
private

Given the new chi2, next position is calculated and updated.

m_changes[ParameterIndex] updated too

Parameters
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().

◆ boundApplication()

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

Parameters
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().

◆ calculateConvChainAndBestParameters()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::calculateConvChainAndBestParameters ( size_t  convLength,
int  nSteps,
std::vector< std::vector< double > > &  reducedChain,
std::vector< double > &  bestParameters,
std::vector< double > &  errorLeft,
std::vector< double > &  errorRight 
)
private

Calculated converged chain and parameters.

Create the reduced convergence chain and calculate the best parameter values and errors.

Parameters
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().

◆ convergenceCheck()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::convergenceCheck ( )
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().

◆ costFunctionVal()

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::costFunctionVal ( )
overridevirtual

Return current value of the cost function.

Implements Mantid::API::IFuncMinimizer.

Definition at line 289 of file FABADAMinimizer.cpp.

References m_chi2.

◆ finalize()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::finalize ( )
overridevirtual

◆ gaussianStep()

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::gaussianStep ( const double &  jump)
private

Returns the step from a Gaussian given sigma = Jump.

Returns the step from a Gaussian given sigma = jump.

Parameters
jump:: sigma
Returns
:: the step

Definition at line 362 of file FABADAMinimizer.cpp.

Referenced by iterate().

◆ getMostProbableChiSquared()

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::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 
)
private

Finds the most probable Chi Squared value.

Definition at line 825 of file FABADAMinimizer.cpp.

References m_nParams.

Referenced by outputPDF().

◆ initChainsAndParameters()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::initChainsAndParameters ( )
private

◆ initialize()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::initialize ( API::ICostFunction_sptr  function,
size_t  maxIterations 
)
overridevirtual

Initialize minimizer, i.e. pass a function to minimize.

Initialize minimizer.

Set initial values for all private members

Parameters
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.

◆ initSimulatedAnnealing()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::initSimulatedAnnealing ( )
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().

◆ iterate()

bool Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::iterate ( size_t  iter)
overridevirtual

◆ iterationContinuation()

bool Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::iterationContinuation ( )
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().

◆ jumpUpdate()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::jumpUpdate ( const size_t &  parameterIndex)
private

Updates the ParameterIndex-th parameter jump if appropriate.

Updates the parameterIndex-th parameter jump if appropriate.

Parameters
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().

◆ name()

std::string Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::name ( ) const
inlineoverridevirtual

Name of the minimizer.

Implements Mantid::API::IFuncMinimizer.

Definition at line 37 of file FABADAMinimizer.h.

◆ outputChains()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputChains ( )
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().

◆ outputConvergedChains()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputConvergedChains ( size_t  convLength,
int  nSteps 
)
private

Output converged chains.

Create the workspace containing the converged chain.

Parameters
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().

◆ outputCostFunctionTable()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputCostFunctionTable ( size_t  convLength,
double  mostProbableChi2 
)
private

Output cost function.

Create the workspace containing chi2 values.

Parameters
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().

◆ outputParameterTable()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputParameterTable ( const std::vector< double > &  bestParameters,
const std::vector< double > &  errorLeft,
const std::vector< double > &  errorRight 
)
private

Output parameter table.

Create the table workspace containing parameter values.

Parameters
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().

◆ outputPDF() [1/2]

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputPDF ( std::size_t const &  convLength,
std::vector< std::vector< double > > &  reducedChain 
)
private

Output PDF.

Create the workspace containing probability density function (PDF)

Parameters
convLength:: length of the converged chain
reducedChain:: the reduced chain (will be sorted)
Returns
:: most probable chi square value

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().

◆ outputPDF() [2/2]

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::outputPDF ( std::vector< double > &  xValues,
std::vector< double > &  yValues,
std::vector< std::vector< double > > &  reducedChain,
std::size_t const &  convLength,
int const &  pdfLength 
)
private

◆ setParameterXAndYValuesForPDF()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::setParameterXAndYValuesForPDF ( std::vector< double > &  xValues,
std::vector< double > &  yValues,
std::vector< std::vector< double > > &  reducedChain,
std::size_t const &  convLength,
int const &  pdfLength 
)
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().

◆ simAnnealingRefrigeration()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::simAnnealingRefrigeration ( )
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().

◆ tieApplication()

void Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::tieApplication ( const size_t &  parameterIndex,
EigenVector newParameters,
double &  newValue 
)
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

Parameters
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().

Member Data Documentation

◆ m_chain

std::vector<std::vector<double> > Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_chain
private

◆ m_chainIterations

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_chainIterations
private

The number of chain iterations.

Definition at line 112 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initChainsAndParameters(), initialize(), iterate(), and iterationContinuation().

◆ m_changes

std::vector<int> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_changes
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().

◆ m_changesOld

std::vector<int> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_changesOld
private

To track convergence through immobility.

Definition at line 153 of file FABADAMinimizer.h.

Referenced by initChainsAndParameters(), and jumpUpdate().

◆ m_chi2

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_chi2
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().

◆ m_converged

bool Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_converged
private

Boolean that indicates global convergence.

Definition at line 124 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initialize(), iterate(), and iterationContinuation().

◆ m_convPoint

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_convPoint
private

The point when convergence has been reached.

Definition at line 126 of file FABADAMinimizer.h.

Referenced by calculateConvChainAndBestParameters(), convergenceCheck(), and outputConvergedChains().

◆ m_counter

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_counter
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().

◆ m_counterGlobal

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_counterGlobal
private

The global number of iterations done.

Definition at line 138 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initialize(), iterate(), and iterationContinuation().

◆ m_criteria

std::vector<double> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_criteria
private

Convergence criteria for each parameter.

Definition at line 130 of file FABADAMinimizer.h.

Referenced by initChainsAndParameters(), and iterate().

◆ m_fitFunction

API::IFunction_sptr Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_fitFunction
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().

◆ m_jump

std::vector<double> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_jump
private

The jump for each parameter.

Definition at line 116 of file FABADAMinimizer.h.

Referenced by boundApplication(), initChainsAndParameters(), iterate(), and jumpUpdate().

◆ m_leastSquares

std::shared_ptr<CostFunctions::CostFuncLeastSquares> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_leastSquares
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().

◆ m_leftRefrPoints

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_leftRefrPoints
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().

◆ m_maxIter

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_maxIter
private

Maximum number of iterations.

Definition at line 132 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initialize(), and iterationContinuation().

◆ m_nParams

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_nParams
private

◆ m_numInactiveRegenerations

std::vector<size_t> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_numInactiveRegenerations
private

Number of consecutive regenerations without changes.

Definition at line 151 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initChainsAndParameters(), and jumpUpdate().

◆ m_overexploration

bool Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_overexploration
private

Overexploration applied.

Definition at line 146 of file FABADAMinimizer.h.

Referenced by initialize(), and initSimulatedAnnealing().

◆ m_parameters

EigenVector Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_parameters
private

Parameters' values.

Definition at line 118 of file FABADAMinimizer.h.

Referenced by algorithmDisplacement(), boundApplication(), initChainsAndParameters(), and iterate().

◆ m_parChanged

std::vector<bool> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_parChanged
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().

◆ m_parConverged

std::vector<bool> Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_parConverged
private

Convergence of each parameter.

Definition at line 128 of file FABADAMinimizer.h.

Referenced by convergenceCheck(), initChainsAndParameters(), iterate(), and iterationContinuation().

◆ m_simAnnealingItStep

size_t Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_simAnnealingItStep
private

Number of iterations between Simulated Annealing refrigeration points.

Definition at line 140 of file FABADAMinimizer.h.

Referenced by initialize(), initSimulatedAnnealing(), and iterate().

◆ m_temperature

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_temperature
private

Simulated Annealing temperature.

Definition at line 136 of file FABADAMinimizer.h.

Referenced by algorithmDisplacement(), convergenceCheck(), initSimulatedAnnealing(), and simAnnealingRefrigeration().

◆ m_tempStep

double Mantid::CurveFitting::FuncMinimisers::FABADAMinimizer::m_tempStep
private

Temperature step between different Simulated Annealing phases.

Definition at line 144 of file FABADAMinimizer.h.

Referenced by initSimulatedAnnealing(), and simAnnealingRefrigeration().


The documentation for this class was generated from the following files: