[669123]: / src / modules / bugs / distributions / DWeib.h  Maximize  Restore  History

Download this file

37 lines (31 with data), 870 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
#ifndef DWEIB_H_
#define DWEIB_H_
#include <distribution/RScalarDist.h>
namespace jags {
namespace bugs {
/**
* <pre>
* x ~ dweib(a, b)
* f(x|b,a) = a * b * x^(b - 1) * exp (- a * x^b)
* </pre>
* @short Weibull distribution
*/
class DWeib : public RScalarDist {
public:
DWeib();
std::string alias() const;
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;
};
}}
#endif /* DWEIB_H_ */