versatile-mcmc  0.1.7
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
vmcmc::Parameter Class Reference

This class represents a fit parameter of the target function to be sampled from. More...

#include <parameter.hpp>

Public Member Functions

 Parameter (const std::string &name, double startValue, double absoluteError, boost::optional< double > lowerLimit=boost::none, boost::optional< double > upperLimit=boost::none, bool fixed=false)
 
const std::string & GetName () const
 
void SetName (const std::string &name)
 
double GetStartValue () const
 
void SetStartValue (double startValue)
 
double GetAbsoluteError () const
 
void SetAbsoluteError (double absoluteError)
 
void SetRelativeError (double relativeError)
 Sets the absolute error by multiplying a relative error argument with the before-hand configured start value. More...
 
const boost::optional< double > & GetLowerLimit () const
 
void SetLowerLimit (const boost::optional< double > &lowerLimit)
 
const boost::optional< double > & GetUpperLimit () const
 
void SetUpperLimit (const boost::optional< double > &upperLimit)
 
bool IsFixed () const
 
void SetFixed (bool fixed)
 
bool IsInsideLimits (double someValue) const
 Checks if some parameter value is inside the configured parameter limits. More...
 
void ConstrainToLimits (double &someValue) const
 If a value lies outside the parameter limits, constrain it accordingly. More...
 
bool ReflectFromLimits (double &someValue) const
 If a value lies outside a parameter limits, attempt a reflection from the closer limit. More...
 

Static Public Member Functions

static Parameter FixedParameter (const std::string &name="", double startValue=0.0)
 

Protected Member Functions

void CheckLimits ()
 

Protected Attributes

std::string fName
 
double fStartValue
 
double fAbsoluteError
 
boost::optional< double > fLowerLimit
 
boost::optional< double > fUpperLimit
 
bool fFixed
 

Detailed Description

This class represents a fit parameter of the target function to be sampled from.

Its purpose is to instruct the MCMC algorithm at what point in the parameter space (start value) with what step size (error) to start sampling. It also holds optional lower and upper value limits, which correspond to step-function like priors. If the property 'fixed' is set, the sampler should never vary the parameter from its start value.

Member Function Documentation

void vmcmc::Parameter::ConstrainToLimits ( double &  someValue) const

If a value lies outside the parameter limits, constrain it accordingly.

Parameters
someValueA reference to the value to be constrained.
bool vmcmc::Parameter::IsInsideLimits ( double  someValue) const

Checks if some parameter value is inside the configured parameter limits.

Parameters
someValue
Returns
False, if someValue < Parameter::fLowerLimit || someValue > Parameter::fUpperLimit.
bool vmcmc::Parameter::ReflectFromLimits ( double &  someValue) const

If a value lies outside a parameter limits, attempt a reflection from the closer limit.

Parameters
someValueA reference to the value to be reflected.
Returns
True, if someValue did not have to be modified or was reflected successfully (without exceeding the opposite limit).
void vmcmc::Parameter::SetRelativeError ( double  relativeError)

Sets the absolute error by multiplying a relative error argument with the before-hand configured start value.

Parameters
relativeError

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