示例#1
0
        public void test_AIC()
        {
            /*Result calculated with R.*/
            List <double> y = new List <double>()
            {
                1, 2.2, 3.1, 2.5
            };
            List <double> x1 = new List <double>()
            {
                177, 175, 183, 167
            };
            List <double> x2 = new List <double>()
            {
                3, 5, 6, 9
            };
            List <List <double> > x = new List <List <double> >()
            {
                x1, x2
            };

            Assert.AreEqual(-4.032542, Math.Round(ModelFit.AIC(y, x), 6));
        }
示例#2
0
 /// <summary>
 /// returns the akaike information criteria value for model m.
 /// </summary>
 /// <exception cref="ArgumentException">Thrown when any variable in the model has
 /// different number of obesrvations.</exception>
 public double EvaluateFitness(Model m)
 {
     return(ModelFit.AIC(m.getYVar().values, m.getXVariableLists()));
 }