gravatar
alpar (Alpar Juttner)
alpar@cs.elte.hu
Serious buxfixes in Random::gamma() and Random::pareto()
0 1 0
default
1 file changed with 2 insertions and 2 deletions:
↑ Collapse diff ↑
Show white space 6 line context
... ...
@@ -795,7 +795,7 @@
795 795
	    nu=V0*std::exp(-xi);
796 796
	  }
797 797
      } while(nu>std::pow(xi,delta-1.0)*std::exp(-xi));
798
      return theta*(xi-gamma(int(std::floor(k))));
798
      return theta*(xi+gamma(int(std::floor(k))));
799 799
    }
800 800
    
801 801
    /// Weibull distribution
... ...
@@ -819,7 +819,7 @@
819 819
    ///
820 820
    double pareto(double k,double x_min)
821 821
    {
822
      return exponential(gamma(k,1.0/x_min));
822
      return exponential(gamma(k,1.0/x_min))+x_min;
823 823
    }  
824 824
      
825 825
    /// Poisson distribution
0 comments (0 inline)