Packages

class ARIMA extends Forecaster

The ARIMA class provides basic time series analysis capabilities for Auto- Regressive 'AR' Integrated 'I' Moving-Average 'MA' models. In an 'ARIMA(p, d, q)' model, 'p' and 'q' refer to the order of the Auto-Regressive and Moving-Average components of the model; 'd' refers to the order of differencing. ARIMA 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 values of 'y' and its noise:

y_t = c + Σ(φ_i y_t-i) + Σ(θ_i e_t-i) + e_t

where 'c' is a constant, 'φ' is the autoregressive coefficient vector, 'θ' is the moving-average coefficient vector, and 'e' is the noise vector. If 'd' > 0, then the time series must be differenced first before applying the above model. ------------------------------------------------------------------------------

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

Instance Constructors

  1. new ARIMA(t: VectoD, y: VectoD, d: Int = 0)

    t

    the time vector

    y

    the input vector (time series data)

    d

    the order of Integration (number of differences)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. val acf: VectorD
  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  7. def diagnose(yy: VectoD, ee: VectoD): Unit

    Compute diagnostics for the forecaster.

    Compute diagnostics for the forecaster. Override to add more diagnostics. Note, for 'mse' and 'rmse', 'sse' is divided by the number of instances 'm' rather than the degrees of freedom.

    yy

    the response vector, actual values

    ee

    the residual/error vector

    Attributes
    protected
    Definition Classes
    Forecaster
    See also

    en.wikipedia.org/wiki/Mean_squared_error

  8. def difference(): VectorD

    Difference the time series based on value of 'd'.

  9. def durbinLevinson: MatriD

    Apply the Durbin-Levinson Algorithm to iteratively compute the 'psi' matrix.

    Apply the Durbin-Levinson Algorithm to iteratively compute the 'psi' matrix. The last row of the matrix gives 'AR' coefficients.

    See also

    www.stat.tamu.edu/~suhasini/teaching673/time_series.pdf

  10. var e: VectoD
    Attributes
    protected
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  13. def est_ar(p_: Int = 1): VectoD

    Estimate the coefficient vector 'φ' for a 'p'th order Auto-Regressive 'AR(p)' model.

    Estimate the coefficient vector 'φ' for a 'p'th order Auto-Regressive 'AR(p)' model.

    x_t = φ_0 * x_t-1 + ... + φ_p-1 * x_t-p + e_t

    Uses the Durbin-Levinson Algorithm to determine the coefficients. The 'φ' vector is 'p'th row of 'psi' matrix (ignoring the first (0th) column).

    p_

    the order of the AR model

  14. def est_arma(p_: Int = 1, q_: Int = 1): (VectoD, VectoD)

    Estimate the coefficient vectors φ and θ for a ('p'th, 'q'th) order Auto-Regressive Moving-Average 'ARIMA(p, q)' model.

    Estimate the coefficient vectors φ and θ for a ('p'th, 'q'th) order Auto-Regressive Moving-Average 'ARIMA(p, q)' model.

    x_t = φ_0 * x_t-1 + ... + φ_p-1 * x_t-p + θ_0 * e_t-1 + ... + θ_q-1 * e_t-q + e_t

    p_

    the order of the AR part of the model

    q_

    the order of the MA part of the model

    See also

    www.math.kth.se/matstat/gru/sf2943/tsform.pdf

  15. def est_ma(q_: Int = 1): VectoD

    Estimate the coefficient vector 'θ' for a 'q'th order a Moving-Average 'MA(q)' model.

    Estimate the coefficient vector 'θ' for a 'q'th order a Moving-Average 'MA(q)' model.

    x_t = θ_0 * e_t-1 + ... + θ_q-1 * e_t-q + e_t

    q_

    the order of the AR model

  16. def eval(): Unit

    Compute the error and useful diagnostics.

    Compute the error and useful diagnostics.

    Definition Classes
    ARIMAForecaster
  17. def f_(z: Double): String

    Format a double value.

    Format a double value.

    z

    the double value to format

    Definition Classes
    Forecaster
  18. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def fit: VectoD

    Return the quality of fit including 'sst', 'sse', 'mae', rmse' and 'rSq'.

    Return the quality of fit including 'sst', 'sse', 'mae', rmse' and 'rSq'. Note, if 'sse > sst', the model introduces errors and the 'rSq' may be negative, otherwise, R^2 ('rSq') ranges from 0 (weak) to 1 (strong). Note that 'rSq' is the last or number 5 measure. Override to add more quality of fit measures.

    Definition Classes
    Forecaster
  20. def fitLabel: Seq[String]

    Return the labels for the fit.

    Return the labels for the fit. Override when necessary.

    Definition Classes
    Forecaster
  21. def fitMap: Map[String, String]

    Build a map of quality of fit measures (use of LinedHashMap makes it ordered).

    Build a map of quality of fit measures (use of LinedHashMap makes it ordered). Override to add more quality of fit measures.

    Definition Classes
    Forecaster
  22. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  23. def forecast(h: Int): VectoD

    Produce forecasts for 'h' steps ahead into the future

    Produce forecasts for 'h' steps ahead into the future

    h

    the forecasting horizon, number of steps ahead to produce forecasts

    Definition Classes
    ARIMAForecaster
  24. def forecast(): VectoD

    Produce forecasts for one step ahead into the future

    Produce forecasts for one step ahead into the future

    Definition Classes
    Forecaster
  25. def forecast_ar(steps: Int = 1): VectoD

    Produce the multi-step forecast for AR models.

    Produce the multi-step forecast for AR models.

    steps

    the number of steps to forecast, must be at least one.

  26. def forecast_arma(steps: Int = 1): VectoD

    Produce the one-step forecast for ARMA models

    Produce the one-step forecast for ARMA models

    steps

    the number of steps to forecast, must be at least one.

    See also

    ams.sunysb.edu/~zhu/ams586/Forecasting.pdf

  27. def forecast_ma(steps: Int = 1): VectoD

    Produce the one-step forecast for MA models

    Produce the one-step forecast for MA models

    steps

    the number of steps to forecast, must be at least one.

    See also

    ams.sunysb.edu/~zhu/ams586/Forecasting.pdf

  28. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  29. def hannanRissanen(): VectoD

    Apply the Hannan-Rissanen Algorithm to estimate the 'ARMA(p, q)' coefficients.

    Apply the Hannan-Rissanen Algorithm to estimate the 'ARMA(p, q)' coefficients.

    See also

    halweb.uc3m.es/esp/Personal/personas/amalonso/esp/TSAtema9.pdf

  30. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  31. val index_rSq: Int
    Definition Classes
    Forecaster
  32. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  33. val mae: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  34. val mape: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  35. def methodOfInnovations(): VectoD

    Apply the Method of Innovation to estimate coefficients for MA(q) model.

    Apply the Method of Innovation to estimate coefficients for MA(q) model.

    See also

    www.math.kth.se/matstat/gru/sf2943/tsform.pdf

    www.stat.berkeley.edu/~bartlett/courses/153-fall2010/lectures/10.pdf

  36. val mse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  37. val mu: Double
  38. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  39. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  40. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  41. var pacf: VectoD
  42. def plotFunc(fVec: VectoD, name: String): Unit

    Plot a function, e.g., Auto-Correlation Function 'ACF', Partial Auto-Correlation Function 'PACF'.

    Plot a function, e.g., Auto-Correlation Function 'ACF', Partial Auto-Correlation Function 'PACF'.

    fVec

    the vector given function values

    name

    the name of the function

  43. def predict(): VectoD

    Return the vector of predicted values on the training data

    Return the vector of predicted values on the training data

    Definition Classes
    ARIMAForecaster
  44. def predictAll: VectoD

    For all the time points, predict all the values of 'y = f(t)'.

  45. def predict_ar(transBack: Boolean = true): VectoD

    Return a vector that is the predictions of a 'p'th order Auto-Regressive 'AR(p)' model.

    Return a vector that is the predictions of a 'p'th order Auto-Regressive 'AR(p)' model.

    transBack

    flag that determines whether to return the predicted values in the original scale

  46. def predict_arma(transBack: Boolean = true): VectoD

    Return a vector that is the predictions of a ('p'th, 'q'th) order Auto-Regressive Moving-Average 'ARMA(p, q)' model.

    Return a vector that is the predictions of a ('p'th, 'q'th) order Auto-Regressive Moving-Average 'ARMA(p, q)' model.

    transBack

    flag that determines whether to return the predicted values in the original scale

  47. def predict_ma(transBack: Boolean = true): VectoD

    Return a vector of predictions of an MA model and update the residuals

    Return a vector of predictions of an MA model and update the residuals

    transBack

    flag that determines whether to return the predicted values in the original scale

  48. val rSq: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  49. val rmse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  50. def setPQ(p_: Int, q_: Int): Unit

    Set values for 'p' and 'q'.

    Set values for 'p' and 'q'.

    p_

    the order of the AR part of the model

    q_

    the order of the MA part of the model

  51. def smooth(l: Int): VectoD

    Smooth the 'y' vector by taking the 'l'th order moving average.

    Smooth the 'y' vector by taking the 'l'th order moving average.

    l

    the number of points to average

  52. val sse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  53. val ssr: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  54. val sst: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  55. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  56. def toString(): String
    Definition Classes
    AnyRef → Any
  57. def train(): ARIMA

    Train/fit an ARIMA model to times the series data.

    Train/fit an ARIMA model to times the series data. Must call setPQ first.

    Definition Classes
    ARIMAForecaster
  58. def transformBack(xp: VectoD): VectoD

    Transform the predictions/fitted values of a differenced time series back to the original scale.

    Transform the predictions/fitted values of a differenced time series back to the original scale.

    xp

    the vector of predictions/fitted values of a differenced time series

    See also

    stats.stackexchange.com/questions/32634/difference-time-series-before-arima-or-within-arima

  59. def transformBack_f(xf: VectoD): VectoD

    Transform the forecasted values of a differenced time series back to the original scale.

    Transform the forecasted values of a differenced time series back to the original scale.

    xf

    the vector of forecasted values of a differenced time series

    See also

    stats.stackexchange.com/questions/32634/difference-time-series-before-arima-or-within-arima

  60. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  61. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  62. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from Forecaster

Inherited from Error

Inherited from AnyRef

Inherited from Any

Ungrouped