1 #ifndef __BCPARAMETER__H 2 #define __BCPARAMETER__H 25 #include "BCVariable.h" 57 BCParameter(
const std::string& name,
double lowerlimit,
double upperlimit,
const std::string& latexname =
"",
const std::string& unitstring =
"");
87 {
return fFixedValue; }
102 {
double lp =
GetLogPrior(x);
return (std::isfinite(lp)) ? exp(lp) : ((lp < 0) ? 0 : std::numeric_limits<double>::infinity()); }
136 virtual void SetLimits(
double lowerlimit = 0,
double upperlimit = 1);
141 virtual bool Fix(
double value)
142 { fFixed =
true; fFixedValue = value;
return true;}
147 { fFixed =
false;
return true;}
162 std::string
OneLineSummary(
bool print_prefix =
true,
int name_length = -1)
const;
virtual void SetPrior(BCPrior *const prior)
Set prior.
A class to represent the prior of a parameter.
virtual double GetRandomValueAccordingToPrior(TRandom *const rng) const
virtual double GetPriorMean() const
virtual bool Fix(double value)
Fix parameter to value (set prior to delta).
virtual double GetPrior(double x) const
friend void swap(BCParameter &A, BCParameter &B)
swap
double fUpperLimit
The upper limit of the variable value.
virtual double GetPriorMode() const
virtual ~BCParameter()
Destructor.
A class representing a variable of a model.
virtual double GetPriorVariance() const
virtual BCPrior * GetPrior()
double fLowerLimit
The lower limit of the variable value.
virtual double GetLogPrior(double x) const
Get log of value of prior at parameter value.
A class representing a parameter of a model.
std::string OneLineSummary(bool print_prefix=true, int name_length=-1) const
virtual double GetFixedValue() const
virtual bool Unfix()
Unfix parameter.
virtual void SetLimits(double lowerlimit=0, double upperlimit=1)
Set the limits of the parameter values.
BCParameter & operator=(BCParameter other)
Copy operator.
virtual bool Fixed() const
BCParameter()
The default constructor.
virtual void SetPriorConstant()
Set constant prior.
virtual const BCPrior * GetPrior() const