net.sourceforge.openforecast.models
Class NaiveForecastingModel
- java.lang.Object
-
- net.sourceforge.openforecast.models.AbstractForecastingModel
-
- net.sourceforge.openforecast.models.AbstractTimeBasedModel
-
- net.sourceforge.openforecast.models.WeightedMovingAverageModel
-
- net.sourceforge.openforecast.models.MovingAverageModel
-
- net.sourceforge.openforecast.models.NaiveForecastingModel
-
- All Implemented Interfaces:
- ForecastingModel
public class NaiveForecastingModel extends MovingAverageModel
A naive forecasting model is a special case of the moving average forecasting model where the number of periods used for smoothing is 1. Therefore, the forecast for a period, t, is simply the observed value for the previous period, t-1.Due to the simplistic nature of the naive forecasting model, it can only be used to forecast up to one period in the future. It is not at all useful as a medium-long range forecasting tool.
This model really is a simplistic model, and is included partly for completeness and partly because of its simplicity. It is unlikely that you'll want to use this model directly. Instead, consider using either the moving average model, or the more general weighted moving average model with a higher (i.e. greater than 1) number of periods, and possibly a different set of weights.
- Since:
- 0.3
-
-
Constructor Summary
Constructors Constructor and Description NaiveForecastingModel()Constructs a new naive forecasting model.NaiveForecastingModel(java.lang.String independentVariable)Deprecated.As of 0.4, replaced byNaiveForecastingModel(java.lang.String).
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.StringgetForecastType()Returns a one or two word name of this type of forecasting model.java.lang.StringtoString()This should be overridden to provide a textual description of the current forecasting model including, where possible, any derived parameters used.-
Methods inherited from class net.sourceforge.openforecast.models.MovingAverageModel
init
-
Methods inherited from class net.sourceforge.openforecast.models.WeightedMovingAverageModel
getNumberOfPredictors
-
Methods inherited from class net.sourceforge.openforecast.models.AbstractTimeBasedModel
forecast, getIndependentVariable, getMaximumTimeValue, getMinimumTimeValue, getTimeVariable
-
-
-
-
Constructor Detail
-
NaiveForecastingModel
public NaiveForecastingModel()
Constructs a new naive forecasting model. For a valid model to be constructed, you should call init and pass in a data set containing a series of data points with the time variable initialized to identify the independent variable.
-
NaiveForecastingModel
public NaiveForecastingModel(java.lang.String independentVariable)
Deprecated. As of 0.4, replaced byNaiveForecastingModel(java.lang.String).Constructs a new naive forecasting model, using the given name as the independent variable.- Parameters:
independentVariable- the name of the independent variable to use in this model.
-
-
Method Detail
-
getForecastType
public java.lang.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.- Specified by:
getForecastTypein interfaceForecastingModel- Overrides:
getForecastTypein classMovingAverageModel- Returns:
- a string representation of the type of forecasting model implemented.
-
toString
public java.lang.String toString()
This should be overridden to provide a textual description of the current forecasting model including, where possible, any derived parameters used.- Specified by:
toStringin interfaceForecastingModel- Overrides:
toStringin classMovingAverageModel- Returns:
- a string representation of the current forecast model, and its parameters.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG