net.sourceforge.openforecast
Interface ForecastingModel

All Known Implementing Classes:
AbstractForecastingModel, AbstractTimeBasedModel, DoubleExponentialSmoothingModel, MovingAverageModel, MultipleLinearRegressionModel, NaiveForecastingModel, PolynomialRegressionModel, RegressionModel, SimpleExponentialSmoothingModel, TripleExponentialSmoothingModel, WeightedMovingAverageModel

public interface ForecastingModel

Defines a consistent interface that must be implemented by all Forecasting Models. Note that any forecasting model should first be initialized by calling init. Once init has been called, any of the other methods can be expected to return reasonable results.

Author:
Steven R. Gould

Method Summary
 double forecast(DataPoint dataPoint)
          Using the current model parameters (initialized in init), apply the forecast model to the given data point.
 DataSet forecast(DataSet dataSet)
          Using the current model parameters (initialized in init), apply the forecast model to the given data set.
 double getAIC()
          Returns the Akaike Information Criteria obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 double getBias()
          Returns the bias - the arithmetic mean of the errors - obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 String getForecastType()
          Returns a one or two word name of this type of forecasting model.
 double getMAD()
          Returns the mean absolute deviation obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 double getMAPE()
          Returns the mean absolute percentage error obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 double getMSE()
          Returns the mean square of the errors (MSE) obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 int getNumberOfPredictors()
          Returns the number of predictors used by the underlying model.
 double getSAE()
          Returns the sum of the absolute errors (SAE) obtained from applying the current forecasting model to the initial data set to try and predict each data point.
 void init(DataSet dataSet)
          Used to initialize the model-specific parameters and customize them to the given data set.
 String toString()
          This should be overridden to provide a textual description of the current forecasting model including, where possible, any derived parameters used.
 

Method Detail

init

void init(DataSet dataSet)
Used to initialize the model-specific parameters and customize them to the given data set. This method must be called before any other method in the class.

Parameters:
dataSet - a data set of observations that can be used to initialize the forecasting parameters of the forecasting model.

getAIC

double getAIC()
Returns the Akaike Information Criteria obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to your initial data set - the smaller the Akaike Information Criteria (AIC), the more accurate the model.

Returns:
the Akaike Information Criteria (AIC) when the current model was applied to the initial data set.
Since:
0.5

getBias

double getBias()
Returns the bias - the arithmetic mean of the errors - obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to your initial data set - the closer the bias is to zero, the more accurate the model.

Returns:
the bias - mean of the errors - when the current model was applied to the initial data set.

getMAD

double getMAD()
Returns the mean absolute deviation obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to your initial data set - the smaller the Mean Absolute Deviation (MAD), the more accurate the model.

Returns:
the mean absolute deviation (MAD) when the current model was applied to the initial data set.

getMAPE

double getMAPE()
Returns the mean absolute percentage error obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to the initial data set - the smaller the Mean Absolute Percentage Error (MAPE), the more accurate the model.

Returns:
the mean absolute percentage error (MAPE) when the current model was applied to the initial data set.

getMSE

double getMSE()
Returns the mean square of the errors (MSE) obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to your initial data set - the smaller the Mean Square of the Errors, the more accurate the model.

Returns:
the mean square of the errors (MSE) when the current model was applied to the initial data set.

getSAE

double getSAE()
Returns the sum of the absolute errors (SAE) obtained from applying the current forecasting model to the initial data set to try and predict each data point. The result is an indication of the accuracy of the model when applied to your initial data set - the smaller the Sum of Absolute Errors, the more accurate the model.

Returns:
the sum of the absolute errors (SAE) when the current model was applied to the initial data set.

getNumberOfPredictors

int getNumberOfPredictors()
Returns the number of predictors used by the underlying model.

Returns:
the number of predictors used by the underlying model.
Since:
0.5

forecast

double forecast(DataPoint dataPoint)
Using the current model parameters (initialized in init), apply the forecast model to the given data point. The data point must have valid values for the independent variables. Upon return, the value of the dependent variable will be updated with the forecast value computed for that data point.

Parameters:
dataPoint - the data point for which a forecast value (for the dependent variable) is required.
Returns:
the same data point passed in but with the dependent value updated to contain the new forecast value.

forecast

DataSet forecast(DataSet dataSet)
Using the current model parameters (initialized in init), apply the forecast model to the given data set. Each data point in the data set must have valid values for the independent variables. Upon return, the value of the dependent variable will be updated with the forecast values computed.

Parameters:
dataSet - the set of data points for which forecast values (for the dependent variable) are required.
Returns:
the same data set passed in but with the dependent values updated to contain the new forecast values.

getForecastType

String getForecastType()
Returns a one or two word name of this type of forecasting model. Keep this short. A longer description should be implemented in the toString method.

Returns:
a string representation of the type of forecasting model implemented.

toString

String toString()
This should be overridden to provide a textual description of the current forecasting model including, where possible, any derived parameters used.

Overrides:
toString in class Object
Returns:
a string representation of the current forecast model, and its parameters.


OpenForecast, Copyright (c) Steven Gould, 2002-2011