#ifndef DINTERVAL_H_
#define DINTERVAL_H_
#include <distributions/Distribution.h>
/**
* @short Interval censored distribution
* <pre>
* i ~ dinterval(t, cutpoints[])
* f(i|t) = 1 if t < cutpoints[i] and t >= cutpoints[i-1]
* = 0 otherwise
* </pre>
*/
class DInterval : public Distribution {
public:
DInterval();
~DInterval();
double logLikelihood(SArray const &x,
std::vector<SArray const *> const ¶meters) const;
void randomSample(SArray &x,
std::vector<SArray const *> const ¶meters) const;
/**
* Checks that t is scalar and that cutpoints is a vector
*/
bool checkParameterDim(std::vector<SArray const *> const ¶meters) const;
/**
* Checks that cutpoints are in ascending order
*/
bool checkParameterValue(std::vector<SArray const *> const ¶meters) const;
Index const &dim(std::vector<SArray const *> const ¶meters) const;
/**
* Returns zero
*/
unsigned long df(std::vector<SArray const *> const ¶meters) const;
double lowerSupport(unsigned long i,
std::vector<SArray const *> const ¶meters) const;
double upperSupport(unsigned long i,
std::vector<SArray const *> const ¶meters) const;
};
#endif /* DINTERVAL_H_ */
syntax highlighted by Code2HTML, v. 0.9.1