//
// OpenForecast - open source, general-purpose forecasting package.
// Copyright (C) 2004-2011 Steven R. Gould
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public
// License along with this library; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
package net.sourceforge.openforecast.tests;
import net.sourceforge.openforecast.ForecastingModel;
import net.sourceforge.openforecast.DataPoint;
import net.sourceforge.openforecast.DataSet;
import net.sourceforge.openforecast.Observation;
import net.sourceforge.openforecast.models.DoubleExponentialSmoothingModel;
/**
* Tests the implementation of the Double Exponential Smoothing forecasting
* model.
* @author Steven R. Gould
* @since 0.4
*/
public class DoubleExponentialSmoothingTest extends OpenForecastTestCase
{
/**
* The amount of error in the forecast values where the forecast is
* considered "correct" by the test.
*/
private static double TOLERANCE = 0.005;
/**
* The amount of error/tolerance in the Mean Squared Error where the
* forecast is still considered "correct" by the test.
*/
private static double MSE_TOLERANCE = 0.1;
/**
* Constructor required by the JUnit framework.
*/
public DoubleExponentialSmoothingTest( String name )
{
super(name);
}
/**
* A simple exponential smoothing test where the observed data is
* constant. This should result in the same constant forecast for
* any value of the smoothing constant.
*/
public void testConstantDoubleExponentialSmoothing()
{
final int NUMBER_OF_OBSERVATIONS = 25;
// Set up some constant observed values
DataSet observedData = new DataSet();
DataPoint dp;
for ( int t=0; t
Ads help maintain this website.