/// @return double a random number distributed according to the receiver. public override double Random() { if (_chiSquareDistribution == null) { _chiSquareDistribution = new ChiSquareDistribution(_dof - 1); } return(Generator.NextGaussian() * Math.Sqrt((_dof - 1) / _chiSquareDistribution.Random())); }
/// @return double a random number distributed according to the receiver. public override double Random() { if (_chiSquareDistribution1 == null) { _chiSquareDistribution1 = new ChiSquareDistribution(_dof1); _chiSquareDistribution2 = new ChiSquareDistribution(_dof2); } return(_chiSquareDistribution1.Random() * _dof2 / (_chiSquareDistribution2.Random() * _dof1)); }