net.sourceforge.openforecast.tests
Class WeightedMovingAverageTest
- java.lang.Object
-
- junit.framework.Assert
-
- junit.framework.TestCase
-
- net.sourceforge.openforecast.tests.OpenForecastTestCase
-
- net.sourceforge.openforecast.tests.WeightedMovingAverageTest
-
- All Implemented Interfaces:
- junit.framework.Test
public class WeightedMovingAverageTest extends OpenForecastTestCase
Implements a series of tests to test the WeightedMovingAverageModel class.- Since:
- 0.4
-
-
Constructor Summary
Constructors Constructor and Description WeightedMovingAverageTest(java.lang.String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidtestConstantWeightedMovingAverage()A simple weighted moving average test where the observed data is constant.voidtestWeightedMovingAverage()A somewhat more realistic test where the results are known (and were calculated independently of the model).-
Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, setName, toString
-
-
-
-
Constructor Detail
-
WeightedMovingAverageTest
public WeightedMovingAverageTest(java.lang.String name)
-
-
Method Detail
-
testConstantWeightedMovingAverage
public void testConstantWeightedMovingAverage()
A simple weighted moving average test where the observed data is constant. This should result in the same constant forecast.
-
testWeightedMovingAverage
public void testWeightedMovingAverage()
A somewhat more realistic test where the results are known (and were calculated independently of the model). Validates that the WeightedMovingAverageModel returns the expected set of results for the given inputs. This is still not a great test, since the weights are all equal - at 0.25 - so it is equivalent to a four period moving average. Could do with some better test data here.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG