public TimeSeriesPredictionFitness( double[] data, int windowSize, int predictionSize, double[] constants )
{
// check for correct parameters
if ( windowSize >= data.Length )
throw new ArgumentException( "Window size should be less then data amount" );
if ( data.Length - windowSize - predictionSize < 1 )
throw new ArgumentException( "Data size should be enough for window and prediction" );
// save parameters
this.data = data;
this.windowSize = windowSize;
this.predictionSize = predictionSize;
// copy constants
variables = new double[constants.Length + windowSize];
Array.Copy( constants, 0, variables, windowSize, constants.Length );
}