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// SedSAT3 – Sediment Source Assessment Tool, version 3
2// U.S. Geological Survey. See LICENSE.md and DISCLAIMER.md in the repository root.
3
4#ifndef PARAMETER_H
5#define PARAMETER_H
6
7#include "cmbdistribution.h"
8
16enum class _range {
19};
20
76{
77public:
89 Parameter();
90
101 Parameter(const Parameter &param);
102
112 Parameter& operator=(const Parameter &param);
113
132 prior_distribution.distribution = dist_type;
133 }
134
150
158 bool operator==(const string &dist_type);
159
170 double GetVal(const string &quantity);
171
184 void SetRange(const vector<double> &rng);
185
202 void SetRange(double low, double high);
203
213 double GetRange(_range lowhigh);
214
232 void SetRange(_range, double value);
233
243 void SetName(const string &nam) {
244 name = nam;
245 }
246
251 string Name() const {
252 return name;
253 }
254
261 double Value() const {
262 return value;
263 }
264
277 void SetValue(double val) {
278 value = val;
279 }
280
287 double GetValue() {
288 return value;
289 }
290
319
347 double CalcLogPriorProbability(const double x);
348
349private:
361
377
384 string name;
385
396 double value = 0;
397};
398
399#endif // PARAMETER_H
Represents a parametric probability distribution for uncertainty quantification.
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:277
double GetVal(const string &quantity)
Get range bound by string identifier.
Definition parameter.cpp:11
void SetPriorDistribution(distribution_type dist_type)
Set the type of prior probability distribution.
Definition parameter.h:131
double value
Current value of the parameter.
Definition parameter.h:396
Parameter()
Default constructor.
Definition parameter.cpp:6
string name
Parameter name/identifier.
Definition parameter.h:384
double CalcLogPriorProbability(const double x)
Calculate log prior probability density at a given value.
Definition parameter.cpp:93
Distribution prior_distribution
The prior probability distribution for this parameter.
Definition parameter.h:360
Distribution & GetPriorDistribution()
Get reference to the prior distribution object.
Definition parameter.h:147
double GetRange(_range lowhigh)
Get a specific range bound.
Definition parameter.cpp:28
double Value() const
Get the current parameter value.
Definition parameter.h:261
vector< double > range
Allowable range for the parameter [low, high].
Definition parameter.h:376
void SetRange(const vector< double > &rng)
Set the parameter range from a vector.
Definition parameter.cpp:21
double GetValue()
Get the current parameter value (alternative accessor).
Definition parameter.h:287
void UpdatePriorDistribution()
Update prior distribution parameters based on current range.
Definition parameter.cpp:76
Parameter & operator=(const Parameter &param)
Assignment operator.
Definition parameter.cpp:68
string Name() const
Get the parameter name.
Definition parameter.h:251
void SetName(const string &nam)
Set the parameter name/identifier.
Definition parameter.h:243
STL class.
distribution_type
Enumeration of probability distribution types supported in SedSat3.
_range
Enumeration for specifying parameter range bounds.
Definition parameter.h:16
@ low
Lower bound of the parameter range.
Definition parameter.h:17
@ high
Upper bound of the parameter range.
Definition parameter.h:18