Statistics::GammaDistribution

Statistics::GammaDistribution Perl module represents a gamma distribution.
Download

Statistics::GammaDistribution Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Nigel Wetters Gourlay
  • Publisher web site:
  • http://search.cpan.org/~nwetters/File-Touch-0.02/Touch.pm

Statistics::GammaDistribution Tags


Statistics::GammaDistribution Description

Statistics::GammaDistribution Perl module represents a gamma distribution. Statistics::GammaDistribution Perl module represents a gamma distribution.SYNOPSIS use Statistics::GammaDistribution; my $g = Statistics::GammaDistribution->new(); $g->set_order(8.5); print $g->rand(1.0); my @alpha = (0.5,4.5,20.5,6.5,1.5,0.5); my @theta = $g->dirichlet_dist(@alpha);METHODS$gamma = Statistics::GammaDistribution->new();No parameters necessary.$variate = $gamma->rand( SCALE );This function returns a random variate from the gamma distribution. The distribution function is, p(x) dx = {1 over Gamma(a) b^a} x^{a-1} e^{-x/b} dx for x > 0.Where a is the order and b is the scale. Unless supplied as a parameter, SCALE is assumed to be 1.0 if not supplied.$gamma->get/set_order( ORDER );Gets/sets the order of the distribution. Order must be greater than zero.@theta = $gamma->dirichlet_dist( ALPHA );Takes a K-sized array of real numbers (all greater than zero), and returns a K-sized array containing random variates from a Dirichlet distribution. The distribution function is p(theta_1, ..., theta_K) dtheta_1 ... dtheta_K = (1/Z) prod_{i=1}^K theta_i^{alpha_i - 1} delta(1 -sum_{i=1}^K theta_i) dtheta_1 ... dtheta_K for theta_i >= 0 and alpha_i >= 0. The normalization factor Z is Z = {prod_{i=1}^K Gamma(alpha_i)} / {Gamma( sum_{i=1}^K alpha_i)}The random variates are generated by sampling K values from gamma distributions with parameters order=alpha_i, scale=1, and renormalizing. See A.M. Law, W.D. Kelton, Simulation Modeling and Analysis (1991). Requirements: · Perl


Statistics::GammaDistribution Related Software