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
- Author:
- Steven R. Gould
Method Summary |
String |
getForecastType()
Returns a one or two word name of this type of forecasting model. |
String |
toString()
This should be overridden to provide a textual description of the
current forecasting model including, where possible, any derived
parameters used. |
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(String independentVariable)
- Deprecated. As of 0.4, replaced by
NaiveForecastingModel(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.
getForecastType
public 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:
getForecastType
in interface ForecastingModel
- Overrides:
getForecastType
in class MovingAverageModel
- Returns:
- a string representation of the type of forecasting model
implemented.
toString
public 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:
toString
in interface ForecastingModel
- Overrides:
toString
in class MovingAverageModel
- Returns:
- a string representation of the current forecast model, and its
parameters.
OpenForecast, Copyright (c) Steven Gould, 2002-2011