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

Download this file

39 lines (32 with data), 958 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
38
#ifndef DBETA_H_
#define DBETA_H_
#include <distribution/RScalarDist.h>
namespace jags {
namespace bugs {
/**
* @short Beta distribution
* <pre>
* P ~ dbeta(a, b)
* f(p|a,b) = C(a,b) * p^(a -1) * (1 - p)^(b - 1) ; 0 < p < 1
* </pre>
*/
class DBeta : public RScalarDist {
public:
DBeta();
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 a > 0, b > 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 /* DBETA_H_ */

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

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks