Kieker 1.11

kieker.tools.opad.timeseries.forecast
Class AbstractRForecaster

java.lang.Object
  extended by kieker.tools.opad.timeseries.forecast.AbstractForecaster<java.lang.Double>
      extended by kieker.tools.opad.timeseries.forecast.AbstractRForecaster
All Implemented Interfaces:
IForecaster<java.lang.Double>
Direct Known Subclasses:
ARIMA101Forecaster, ARIMAForecaster, CrostonForecaster, CSForecaster, ETSForecaster, MeanForecaster, NaiveForecaster, SESRForecaster

public abstract class AbstractRForecaster
extends AbstractForecaster<java.lang.Double>

Convenience class to implement an IForecaster with R.

Since:
1.10
Author:
Andre van Hoorn, Nikolas Herbst, Andreas Eberlein, Tobias Rudolph, Thomas Duellmann

Field Summary
static int MIN_TS_SIZE_DEFAULT
           
 
Constructor Summary
AbstractRForecaster(ITimeSeries<java.lang.Double> historyTimeseries, java.lang.String modelFunc, java.lang.String forecastFunc, ForecastMethod strategy)
           
AbstractRForecaster(ITimeSeries<java.lang.Double> historyTimeseries, java.lang.String modelFunc, java.lang.String forecastFunc, int confidenceLevel, ForecastMethod strategy)
           
 
Method Summary
protected  IForecastResult createNaNForecast(ITimeSeries<java.lang.Double> timeseries, int numForecastSteps)
           
 IForecastResult forecast(int numForecastSteps)
          Performs a time series forecast for the given number of steps in the future.
protected  java.lang.String forecastOperationOnResult(java.lang.String varNameForecast)
           
protected abstract  java.lang.String[] getForecastFuncParams()
          Returns additional parameters to be appended to the call of the R forecast function.
protected abstract  java.lang.String[] getModelFuncParams()
          Returns additional parameters to be appended to the call of the R forecast model.
protected  java.lang.String lowerOperationOnResult(java.lang.String varNameForecast)
           
static java.lang.Double[] removeNullValues(java.util.List<java.lang.Double> allHistory)
           
protected  boolean satisfiesInputTSRequirements(ITimeSeries<java.lang.Double> timeSeries)
          Checks whether the requirements for the input TS are met.
protected  java.lang.String upperOperationOnResult(java.lang.String varNameForecast)
           
 
Methods inherited from class kieker.tools.opad.timeseries.forecast.AbstractForecaster
getConfidenceLevel, getTsOriginal, prepareForecastTS, supportsConfidence
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

MIN_TS_SIZE_DEFAULT

public static final int MIN_TS_SIZE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

AbstractRForecaster

public AbstractRForecaster(ITimeSeries<java.lang.Double> historyTimeseries,
                           java.lang.String modelFunc,
                           java.lang.String forecastFunc,
                           ForecastMethod strategy)
Parameters:
historyTimeseries - timeseries
modelFunc - modelFunction
forecastFunc - forecastfunction
strategy - FC strategy

AbstractRForecaster

public AbstractRForecaster(ITimeSeries<java.lang.Double> historyTimeseries,
                           java.lang.String modelFunc,
                           java.lang.String forecastFunc,
                           int confidenceLevel,
                           ForecastMethod strategy)
Parameters:
historyTimeseries - timeseries
modelFunc - modelFunction
forecastFunc - forecastfunction
confidenceLevel - value of confedenclevel
strategy - FC strategy
Method Detail

createNaNForecast

protected IForecastResult createNaNForecast(ITimeSeries<java.lang.Double> timeseries,
                                            int numForecastSteps)

forecast

public final IForecastResult forecast(int numForecastSteps)
Description copied from interface: IForecaster
Performs a time series forecast for the given number of steps in the future.

Parameters:
numForecastSteps - amount of to calculate FC steps
Returns:
ForecastResult

satisfiesInputTSRequirements

protected boolean satisfiesInputTSRequirements(ITimeSeries<java.lang.Double> timeSeries)
Checks whether the requirements for the input TS are met. This default implementation checks whether the length of the time series is greater or equal to 5. This method can be overridden by any forecaster if more specific requirements are needed.


lowerOperationOnResult

protected java.lang.String lowerOperationOnResult(java.lang.String varNameForecast)
Parameters:
varNameForecast - Name FC
Returns:
string loweropresult

upperOperationOnResult

protected java.lang.String upperOperationOnResult(java.lang.String varNameForecast)
Parameters:
varNameForecast - name fc
Returns:
string upperopresult

forecastOperationOnResult

protected java.lang.String forecastOperationOnResult(java.lang.String varNameForecast)
Parameters:
varNameForecast - name FC
Returns:
string operation result

getModelFuncParams

protected abstract java.lang.String[] getModelFuncParams()
Returns additional parameters to be appended to the call of the R forecast model.

Returns:
the parameters or null if none

getForecastFuncParams

protected abstract java.lang.String[] getForecastFuncParams()
Returns additional parameters to be appended to the call of the R forecast function.

Returns:
the parameters or null if none

removeNullValues

public static java.lang.Double[] removeNullValues(java.util.List<java.lang.Double> allHistory)
Parameters:
allHistory - List there null values should be deleted in this function
Returns:
List/Array with no NullValues

Kieker 1.11

Copyright 2015 Kieker Project, http://kieker-monitoring.net