19 #ifndef _MLPACK_CORE_DISTRIBUTIONS_GAMMA_DISTRIBUTION_HPP 20 #define _MLPACK_CORE_DISTRIBUTIONS_GAMMA_DISTRIBUTION_HPP 24 #include <boost/program_options.hpp> 27 namespace distribution {
95 void Train(
const arma::mat& rdata,
const double tol = 1e-8);
108 void Train(
const arma::mat& observations,
109 const arma::vec& probabilities,
110 const double tol = 1e-8);
125 void Train(
const arma::vec& logMeanxVec,
126 const arma::vec& meanLogxVec,
127 const arma::vec& meanxVec,
128 const double tol = 1e-8);
147 arma::vec& probabilities)
const;
157 double Probability(
double x,
const size_t dim)
const;
178 arma::vec& logProbabilities)
const;
197 double Alpha(
const size_t dim)
const {
return alpha[dim]; }
199 double&
Alpha(
const size_t dim) {
return alpha[dim]; }
202 double Beta(
const size_t dim)
const {
return beta[dim]; }
204 double&
Beta(
const size_t dim) {
return beta[dim]; }
226 inline bool Converged(
const double aOld,
arma::vec Random() const
This function returns an observation of this distribution.
double & Alpha(const size_t dim)
Modify the alpha parameter of the given dimension.
The core includes that mlpack expects; standard C++ includes and Armadillo.
~GammaDistribution()
Destructor.
void LogProbability(const arma::mat &observations, arma::vec &logProbabilities) const
This function returns the logarithm of the probability of a group of observations.
double Alpha(const size_t dim) const
Get the alpha parameter of the given dimension.
void Train(const arma::mat &rdata, const double tol=1e-8)
This function trains (fits distribution parameters) to new data or the dataset the object owns...
size_t Dimensionality() const
Get the dimensionality of the distribution.
GammaDistribution(const size_t dimensionality=0)
Construct the Gamma distribution with the given number of dimensions (default 0); each parameter will...
double & Beta(const size_t dim)
Modify the beta parameter of the given dimension.
double Beta(const size_t dim) const
Get the beta parameter of the given dimension.
Miscellaneous math random-related routines.
void Probability(const arma::mat &observations, arma::vec &probabilities) const
This function returns the probability of a group of observations.
This class represents the Gamma distribution.