예제 #1
0
        public double getValue()
        {
            double d, c, x, xquadrado, v, u;

            if (this.shape >= 1.0)
            {
                d = this.shape - 1.0 / 3.0;
                c = 1.0 / Math.Sqrt(9.0 * d);
                for (;;)
                {
                    do
                    {
                        x = n.getValue();
                        v = 1.0 + c * x;
                    }while (v <= 0.0);
                    v         = Math.Pow(v, 3);
                    u         = ud.getValue();
                    xquadrado = Math.Pow(x, 2);
                    if (u < 1.0 - .0331 * Math.Pow(xquadrado, 2) || Math.Log(u) < 0.5 * xquadrado + d * (1.0 - v + Math.Log(v)))
                    {
                        return(scale * d * v);
                    }
                }
            }

            else
            {
                double g = new GammaDistribution(shape + 1.0, 1.0);
                double w = ud.getValue();
                return(this.scale * g.getValue() * Math.Pow(w, 1.0 / this.shape));
            }
        }
예제 #2
0
 public double getValue()
 {
     return(this.scale * Math.Pow(-Math.Log(u.getValue()), 1.0 / this.shape));
 }
예제 #3
0
        public double getValue()
        {
            double p = u.getValue();

            return(this.median + this.scale * Math.Tan(Math.PI * (p - 0.5)));
        }