Accord.Tests.Statistics.LogLogLinkFunctionTest.LogLogLinkFunctionConstructorTest C# (CSharp) Method

LogLogLinkFunctionConstructorTest() private method

private LogLogLinkFunctionConstructorTest ( ) : void
return void
        public void LogLogLinkFunctionConstructorTest()
        {
            double beta = 3.14;
            double constant = 2.91;
            LogLogLinkFunction target = new LogLogLinkFunction(beta, constant);

            Assert.AreEqual(beta, target.B);
            Assert.AreEqual(constant, target.A);

            for (int i = 0; i < 11; i++)
            {
                double x = i / 10.0;
                double y = (Math.Log(-Math.Log(x)) - constant) / beta;

                Assert.AreEqual(y, target.Function(x), 1e-10);
                Assert.AreEqual(x, target.Inverse(y), 1e-10);
            }
        }