コード例 #1
0
        public void TestMixedLogLogisticFitting()
        {
            LogLogistic   lg         = new LogLogistic(1.2, 300.0);
            List <double> llSamples  = lg.GenerateSample(5000);
            LogLogistic   lg1        = new LogLogistic(0.7, 80.0);
            List <double> llSamples1 = lg1.GenerateSample(5000);

            DataGen.AppendToLst(llSamples, llSamples1);
            var           ti = llSamples;
            List <double> xi = new List <double> {
                .1
            };
            LogLogistic llModel = new LogLogistic(ti, xi);

            double[]        arr  = new double[] { 0.8, 150.0 };
            Vector <double> init = Vector <double> .Build.DenseOfArray(arr);

            llModel.GradientDescent(init);
            Debug.WriteLine("Model completed!");
            Assert.IsTrue(Math.Abs(llModel.Kappa - 0.83) < 1e-1);
        }