#ifndef DMNORM_H_ #define DMNORM_H_ #include /** * @short Multivariate normal distribution *
 * x[] ~ dmnorm(mu[], T[,])
 * f(x | mu, T) = sqrt(det(T)) * exp(-1/2 * (x-mu) %*% T %*% t(x-mu))
 * 
*/ class DMNorm : public Distribution { public: DMNorm(); ~DMNorm(); double logLikelihood(SArray const &x, std::vector const ¶meters) const; void randomSample(SArray &x, std::vector const ¶meters) const; /** * Checks that mu is a vector, T is a square matrix and the sizes of * mu and T conform. */ bool checkParameterDim (std::vector const ¶meters) const; /** * Checks that T is symmetric. Note that there is currently NO CHECK * that T is positive definite. */ bool checkParameterValue (std::vector const ¶meters) const; Index const &dim(std::vector const ¶meters) const; /** * Convenience random sampler function */ static void randomsample(double *x, double const *mu, double const *tau, int nrow); unsigned long df(std::vector const ¶meters) const; double lowerSupport(unsigned long i, std::vector const ¶meters) const; double upperSupport(unsigned long i, std::vector const ¶meters) const; }; #endif /* DMNORM_H_ */