BCParameterSet.h
1 #ifndef __BCPARAMETERSET__H
2 #define __BCPARAMETERSET__H
3 
12 /*
13  * Copyright (C) 2007-2018, the BAT core developer team
14  * All rights reserved.
15  *
16  * For the licensing terms see doc/COPYING.
17  * For documentation see http://mpp.mpg.de/bat
18  */
19 
20 // ---------------------------------------------------------
21 
22 #include <vector>
23 #include <string>
24 
25 #include "BCParameter.h"
26 #include "BCVariableSet.h"
27 
28 // ---------------------------------------------------------
29 
30 class BCParameterSet : public BCVariableSet<BCParameter>
31 {
32 public:
33 
37 
40  virtual ~BCParameterSet() {};
41 
44  virtual unsigned int GetNFixedParameters() const;
45 
48  virtual unsigned int GetNFreeParameters() const
49  { return Size() - GetNFixedParameters(); }
50 
53  virtual double Volume() const ;
54 
59  virtual bool ArePriorsSet(bool ignore_fixed = true) const;
60 
65  virtual bool IsWithinLimits(const std::vector<double>& x) const;
66 
71  virtual bool IsAtFixedValues(const std::vector<double>& x) const;
72 
76  virtual void ValueFromPositionInRange(std::vector<double>& p) const;
77 
81  virtual std::vector<double> GetRangeCenters() const;
82 
86  virtual std::vector<double> GetUniformRandomValues(TRandom* const R) const;
87 
95  virtual std::vector<double> GetRandomValuesAccordingToPriors(TRandom* const R) const;
96 
99  virtual void SetPriorConstantAll();
100 
106  virtual double GetLogPrior(const std::vector<double>& parameters) const;
107 
112  virtual std::vector<double> GetFixedValues(bool include_unfixed = true) const;
113 
117  virtual bool ApplyFixedValues(std::vector<double>& x) const;
118 
119 };
120 #endif
virtual std::vector< double > GetUniformRandomValues(TRandom *const R) const
Get vector of values uniformly distributed in parameter ranges (or at fixed values, if fixed)
virtual unsigned Size() const
Number of variables contained.
virtual unsigned int GetNFixedParameters() const
Wrapper to allow access by name into list of BCParameter.
virtual ~BCParameterSet()
Destructor.
virtual void ValueFromPositionInRange(std::vector< double > &p) const
Translate from unit interval to values in variable ranges, fixing fixed parameters along the way...
virtual double Volume() const
virtual std::vector< double > GetFixedValues(bool include_unfixed=true) const
Get vector of fixed values.
virtual bool IsWithinLimits(const std::vector< double > &x) const
Check if vector of values is within limits.
virtual bool IsAtFixedValues(const std::vector< double > &x) const
Check if fixed parameters in vector of values are at fixed values.
virtual unsigned int GetNFreeParameters() const
BCParameterSet()
Constructor.
virtual double GetLogPrior(const std::vector< double > &parameters) const
Get log of prior; assumes independent priors given for all parameters in set.
virtual void SetPriorConstantAll()
Set all priors to constant.
virtual std::vector< double > GetRangeCenters() const
Get range centers, leaving fixed parameters at fixed values.
virtual bool ArePriorsSet(bool ignore_fixed=true) const
Check whether all parameters have factorized priors set.
virtual bool ApplyFixedValues(std::vector< double > &x) const
Change values to fixed values for fixed parameters.
virtual std::vector< double > GetRandomValuesAccordingToPriors(TRandom *const R) const
Get vector values distributed randomly by the parameter priors.
Wrapper to allow access by name into list of BCVariable.
Definition: BCVariableSet.h:35