Packages

c

scalation.analytics

ExpSmoothing

class ExpSmoothing extends Predictor with Error

The ExpSmoothing class provide very basic time series analysis capabilities of Exponential Smoothing models. ExpSmoothing models are often used for forecasting. Given time series data stored in vector 'y', its next value 'y_t = y(t)' may be predicted based on prior/smoothed values of 'y':

y_t = s_t-1 + α (s_t-1 - s_t-2)

where vector 's' is the smoothed version of vector 'y' and 'α in [0, 1]' is the smoothing parameter. ------------------------------------------------------------------------------

Linear Supertypes
Error, Predictor, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ExpSmoothing
  2. Error
  3. Predictor
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ExpSmoothing(y: VectoD, t: VectoD)

    y

    the input vector (time series data)

    t

    the time vector

Value Members

  1. def coefficient: VectoD

    Return the vector of coefficient/parameter values.

    Return the vector of coefficient/parameter values.

    Definition Classes
    Predictor
  2. def diagnose(yy: VectoD): Unit

    Compute diagostics for the Exponential Smoothing model.

    Compute diagostics for the Exponential Smoothing model.

    yy

    the response vector

    Definition Classes
    ExpSmoothingPredictor
  3. def f_obj(αα: Double): Double

    The objective function to be minimized (sum of squared errors for the given 'αα').

    The objective function to be minimized (sum of squared errors for the given 'αα').

    αα

    the parameter of the objective function to be optimized

  4. def fit: VectorD

    Return the quality of fit including 'rSquared'.

    Return the quality of fit including 'rSquared'. Not providing 'rBarSq'.

    Definition Classes
    ExpSmoothingPredictor
  5. def fitLabels: Seq[String]

    Return the labels for the fit.

    Return the labels for the fit.

    Definition Classes
    ExpSmoothingPredictor
  6. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  7. def predict(s: VectoD): Double

    Predict the next (unknown) value in the time-series.

    Predict the next (unknown) value in the time-series.

    s

    the smoothed time-series data

    Definition Classes
    ExpSmoothingPredictor
  8. def predict(z: VectoI): Double

    Given a new discrete data vector z, predict the y-value of f(z).

    Given a new discrete data vector z, predict the y-value of f(z).

    z

    the vector to use for prediction

    Definition Classes
    Predictor
  9. def residual: VectoD

    Return the vector of residuals/errors.

    Return the vector of residuals/errors.

    Definition Classes
    Predictor
  10. def smooth(α_new: Double = α): VectorD

    Smooth the times series data.

    Smooth the times series data.

    α_new

    the new smoothing parameter, skip to use default

  11. def train(): Unit

    Train the ExpSmoothing model to times series data, by finding the value for the smoothing parameter 'α' that minimizes the sum of squared errors (sse).

    Train the ExpSmoothing model to times series data, by finding the value for the smoothing parameter 'α' that minimizes the sum of squared errors (sse). Use the response passed into the class 'y'.

    Definition Classes
    ExpSmoothingPredictor
  12. def train(yy: VectoD): Unit

    Train the ExpSmoothing model to times series data, by finding the value for the smoothing parameter 'α' that minimizes the sum of squared errors (sse).

    Train the ExpSmoothing model to times series data, by finding the value for the smoothing parameter 'α' that minimizes the sum of squared errors (sse). FIX - use either a penalty or cross-validation, else α -> 1

    yy

    the response vector

    Definition Classes
    ExpSmoothingPredictor