SedSat3 1.1.6
Sediment Source Apportionment Tool - Advanced statistical methods for environmental pollution research
Loading...
Searching...
No Matches
parameter.h
Go to the documentation of this file.
1#ifndef PARAMETER_H
2#define PARAMETER_H
3
4#include "cmbdistribution.h"
5
13enum class _range {
14 low,
15 high
16};
17
73{
74public:
86 Parameter();
87
98 Parameter(const Parameter &param);
99
109 Parameter& operator=(const Parameter &param);
110
131
147
155 bool operator==(const string &dist_type);
156
167 double GetVal(const string &quantity);
168
181 void SetRange(const vector<double> &rng);
182
199 void SetRange(double low, double high);
200
210 double GetRange(_range lowhigh);
211
229 void SetRange(_range, double value);
230
240 void SetName(const string &nam) {
241 name = nam;
242 }
243
248 string Name() const {
249 return name;
250 }
251
258 double Value() const {
259 return value;
260 }
261
274 void SetValue(double val) {
275 value = val;
276 }
277
284 double GetValue() {
285 return value;
286 }
287
316
344 double CalcLogPriorProbability(const double x);
345
346private:
358
373 vector<double> range;
374
381 string name;
382
393 double value = 0;
394};
395
396#endif // PARAMETER_H
Represents a parametric probability distribution for uncertainty quantification.
distribution_type distribution
The type of probability distribution.
Represents a model parameter with prior distribution and constraints.
Definition parameter.h:73
bool operator==(const string &dist_type)
Compare parameter with a string (unused, legacy method)
void SetValue(double val)
Set the current parameter value.
Definition parameter.h:274
double GetVal(const string &quantity)
Get range bound by string identifier.
Definition parameter.cpp:8
void SetPriorDistribution(distribution_type dist_type)
Set the type of prior probability distribution.
Definition parameter.h:128
double value
Current value of the parameter.
Definition parameter.h:393
Parameter()
Default constructor.
Definition parameter.cpp:3
string name
Parameter name/identifier.
Definition parameter.h:381
double CalcLogPriorProbability(const double x)
Calculate log prior probability density at a given value.
Definition parameter.cpp:90
Distribution prior_distribution
The prior probability distribution for this parameter.
Definition parameter.h:357
Distribution & GetPriorDistribution()
Get reference to the prior distribution object.
Definition parameter.h:144
double GetRange(_range lowhigh)
Get a specific range bound.
Definition parameter.cpp:25
double Value() const
Get the current parameter value.
Definition parameter.h:258
vector< double > range
Allowable range for the parameter [low, high].
Definition parameter.h:373
void SetRange(const vector< double > &rng)
Set the parameter range from a vector.
Definition parameter.cpp:18
double GetValue()
Get the current parameter value (alternative accessor)
Definition parameter.h:284
void UpdatePriorDistribution()
Update prior distribution parameters based on current range.
Definition parameter.cpp:73
Parameter & operator=(const Parameter &param)
Assignment operator.
Definition parameter.cpp:65
string Name() const
Get the parameter name.
Definition parameter.h:248
void SetName(const string &nam)
Set the parameter name/identifier.
Definition parameter.h:240
distribution_type
Enumeration of probability distribution types supported in SedSat3.
_range
Enumeration for specifying parameter range bounds.
Definition parameter.h:13
@ low
Lower bound of the parameter range.
@ high
Upper bound of the parameter range.