Accord.Tests.Statistics.LogitLinkFunctionTest.LogitLinkFunctionConstructorTest1 C# (CSharp) Method

LogitLinkFunctionConstructorTest1() private method

private LogitLinkFunctionConstructorTest1 ( ) : void
return void
        public void LogitLinkFunctionConstructorTest1()
        {
            double beta = 3.14;
            double constant = 2.91;

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

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

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