[mlpack-git] [mlpack/mlpack] GammaDistribution: Adds functionality to solve #749 (#751)

Yannis Mentekidis notifications at github.com
Sun Aug 7 07:21:40 EDT 2016


> @@ -53,6 +64,13 @@ void GammaDistribution::Train(const arma::mat& rdata, const double tol)
>    Train(logMeanxVec, meanLogxVec, meanxVec, tol);
>  }
>  
> +// Fits an alpha and beta parameter according to observation probabilities.
> +void GammaDistribution::Train(const arma::mat& observations, 
> +                              const arma::vec& probabilities,
> +                              const double tol)
> +{

I implemented most of the changes. There's a bug in my code for the Train(observations, probabilities) function. I'll push that and the relevant test once it's fixed.

> Testing that could be done by generating points from a Gamma distribution, assigning them a random weight between, e.g., 0.9 and 1, and then generating points from a uniform distribution, and assigning those points a random weight between, e.g, 0.0 and 0.02. Then, call Train() with probabilities, and ensure the resulting trained Gamma distribution is close to the distribution that was used to generate points.

My idea was to get a few points on the x axis and  use `GammaDistribution::Probability(x)` to estimate the pdf at those points, then use the points as observations and their probabilities as the probabilities vector.
The problem is, that generates nan values during the approximation (the bug I'm speaking of). I'm not sure if my idea is bad or my code doesn't work. I'll figure it out :)

---
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/mlpack/mlpack/pull/751/files/9cb117f671f55186baddf38ce71107a2a3ae027f#r73800197
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.cc.gatech.edu/pipermail/mlpack-git/attachments/20160807/36e12fe9/attachment-0001.html>


More information about the mlpack-git mailing list