public void TestEcartTypeBorneInvalide() { double sommeDistance = double.NaN; int nbrPairDonnees = 2; double ecartType = VarianceCalculator.GetEcartType(sommeDistance, nbrPairDonnees); Assert.Equal(double.NaN, ecartType); }
public void TestCalculateVarianceOfProbabilityDistribution(double[] probabilityDistribution, double?expectedVariance) { var varianceCalculator = new VarianceCalculator(); var actualVariance = varianceCalculator.CalculateVarianceOfProbabilityDistribution(probabilityDistribution); if (expectedVariance != null || actualVariance != null) { Assert.LessOrEqual(Math.Abs(actualVariance.Value - expectedVariance.Value), Epsilon); } }
public void TestEcartTypeBorneSuperieure() { const double ecartTypeTest = 4.47; double sommeDistance = 20; int nbrPairDonnees = 1; double ecartType = VarianceCalculator.GetEcartType(sommeDistance, nbrPairDonnees); Assert.Equal(Math.Round(ecartType, 2), ecartTypeTest); }
public void TestEcartTypeBorneInferieure() { const double ecartTypeTest = 10; double sommeDistance = 200; int nbrPairDonnees = 2; double ecartType = VarianceCalculator.GetEcartType(sommeDistance, nbrPairDonnees); Assert.Equal(ecartType, ecartTypeTest); }
public void TestVarianceCalculatorBorneSuperieure() { const double varianceTest = 8.16; List <double> listNumber = new List <double>(); listNumber.Add(10); listNumber.Add(20); listNumber.Add(30); double variance = VarianceCalculator.calculVariance(listNumber); Assert.Equal(variance, varianceTest); }
public void TestVarianceCalculatorBorneInferieure() { const double varianceTest = 173.47; List <double> listNumber = new List <double>(); listNumber.Add(450.332342); listNumber.Add(25.4554); listNumber.Add(232.7777); double variance = VarianceCalculator.calculVariance(listNumber); Assert.Equal(variance, varianceTest); }
public void TestDistanceBorneInvalide() { List <double> listNumber = new List <double>(); listNumber.Add(10); listNumber.Add(double.NaN); listNumber.Add(0); double moyenne = 50; double distance = VarianceCalculator.GetSommeDistance(listNumber, moyenne); Assert.Equal(double.NaN, distance); }
public void TestDistanceBorneSuperieure() { const double distanceTest = 190.07; List <double> listNumber = new List <double>(); listNumber.Add(10.98); listNumber.Add(20.221); listNumber.Add(30.44); double moyenne = 20.98; double distance = VarianceCalculator.GetSommeDistance(listNumber, moyenne); Assert.Equal(distance, distanceTest); }
public void TestDistanceBorneInferieure() { const double distanceTest = 200; List <double> listNumber = new List <double>(); listNumber.Add(10); listNumber.Add(20); listNumber.Add(30); double moyenne = 20; double distance = VarianceCalculator.GetSommeDistance(listNumber, moyenne); Assert.Equal(distance, distanceTest); }
public void TestVarianceCalculatorBorneInvalide() { double variance = VarianceCalculator.calculVariance(null); Assert.Equal(double.NaN, variance); }
public DiceWeighter() { this._random = new Random(); this._distributionGenerator = new CumulativeSumOfIndependentTrialsDistributionGenerator(); this._varianceCalculator = new VarianceCalculator(); }