The fitness function calculates fitness value of 100.0 / ( error + 1 )
where error equals to the sum of absolute differences between predicted value and actual future value.
Sample usage:
// number of points from the past used to predict new one int windowSize = 5; // time series to predict double[] data = new double[13] { 1, 2, 4, 7, 11, 16, 22, 29, 37, 46, 56, 67, 79 }; // constants double[] constants = new double[10] { 1, 2, 3, 5, 7, 11, 13, 17, 19, 23 }; // create population Population population = new Population( 100, new GPTreeChromosome( new SimpleGeneFunction( windowSize + constants.Length ) ), new TimeSeriesPredictionFitness( data, windowSize, 1, constants ), new EliteSelection( ) ); // run one epoch of the population population.RunEpoch( );