public void ComplementaryDistributionFunctionTest()
{
BernoulliDistribution target = new BernoulliDistribution(0.42);
{
double expected = 1.0 - target.DistributionFunction(0);
double actual = target.ComplementaryDistributionFunction(0);
Assert.AreEqual(expected, actual, 1e-6);
}
{
double expected = 1.0 - target.DistributionFunction(1);
double actual = target.ComplementaryDistributionFunction(1);
Assert.AreEqual(expected, actual, 1e-6);
}
{
double expected = 1.0 - target.DistributionFunction(-1);
double actual = target.ComplementaryDistributionFunction(-1);
Assert.AreEqual(expected, actual, 1e-6);
}
{
double expected = 1.0 - target.DistributionFunction(2);
double actual = target.ComplementaryDistributionFunction(2);
Assert.AreEqual(expected, actual, 1e-6);
}
}