[192840]: src / modules / bugs / distributions / DExp.h  Maximize  Restore  History

Download this file

38 lines (31 with data), 947 Bytes

 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
#ifndef DEXP_H_
#define DEXP_H_
#include <distribution/RScalarDist.h>
namespace jags {
namespace bugs {
/**
* @short Exponential distribution
* <pre>
* x ~ dexp(lambda)
* f(x | lambda) = lambda * exp(-lambda * x) ; x >= 0
* </pre>
*/
class DExp : public RScalarDist {
public:
DExp();
double d(double x, PDFType type,
std::vector<double const *> const &parameters, bool give_log) const;
double p(double q, std::vector<double const *> const &parameters, bool lower,
bool give_log) const;
double q(double p, std::vector<double const *> const &parameters, bool lower,
bool log_p) const;
double r(std::vector<double const *> const &parameters, RNG *rng) const;
/**
* Checks that lambda > 0
*/
bool checkParameterValue(std::vector<double const *> const &parameters) const;
double KL(std::vector<double const *> const &par1,
std::vector<double const *> const &par2) const;
};
}}
#endif /* DEXP_H_ */

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks