[081fbe]: src / modules / bugs / distributions / DRound.h Maximize Restore History

Download this file

DRound.h    41 lines (35 with data), 1.3 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#ifndef DROUND_H_
#define DROUND_H_
#include <distribution/ScalarDist.h>
namespace bugs {
/**
* @short Rounded observations
* <pre>
* x ~ dround(t, d)
* f(x|t,d) = 1 if x = t rounded to d decimal places
* = 0 otherwise
* </pre>
*/
class DRound : public ScalarDist {
public:
DRound();
bool checkParameterValue(std::vector<double const *> const &parameters)
const;
bool checkParameterDiscrete(std::vector<bool> const &mask) const;
double logDensity(double const x, PDFType type,
std::vector<double const *> const &parameters,
double const *lower, double const *upper) const;
double randomSample(std::vector<double const *> const &parameters,
double const *lower, double const *upper,
RNG *rng) const;
double typicalValue(std::vector<double const *> const &parameters,
double const *lower, double const *upper) const;
double l(std::vector<double const *> const &parameters) const;
double u(std::vector<double const *> const &parameters) const;
bool isSupportFixed(std::vector<bool> const &fixmask) const;
unsigned int df() const;
double KL(std::vector<double const *> const &par1,
std::vector<double const *> const &par2) const;
};
}
#endif /* DROUND_H_ */