Packages

class SARIMA extends Forecaster

The SARIMA class provides basic time series analysis capabilities for Auto- Regressive 'AR' Integrated 'I' Moving-Average 'MA' models. In an 'SARIMA(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. SARIMA 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. Seasonal differencing, autoregressive and moving average factors can be incorporated into the model by applying seasonal differencing (possibly in addition to simple differencing) first, then add the seasonal autoregressive and moving average terms, that rely on lagged values and errors, respectively, from one or more seasonal periods in the past, on the right hand side of the equation. Exogeous/External regressor may also be added to the right-hand size of the model in a similar manner to Regression models. ------------------------------------------------------------------------------

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

Instance Constructors

  1. new SARIMA(y: VectoD, d: Int = 0, dd: Int = 0, period: Int = 1, xxreg: MatriD = null)

    y

    the input vector (time series data)

    d

    the order of Integration/simple differencing

    dd

    the order of seasonal differencing

    period

    the seasonal period

    xxreg

    optional matrix of external regressors used for dynamic regression

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. var acf: VectoD
  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. var e: VectoD
    Attributes
    protected
  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def eval(): Unit

    Compute the error and useful diagnostics for the entire dataset.

    Compute the error and useful diagnostics for the entire dataset.

    Definition Classes
    SARIMAForecaster
  12. def f_(z: Double): String

    Format a double value.

    Format a double value.

    z

    the double value to format

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

    Return the quality of fit.

    Return the quality of fit. Additional metrics include loglikelihood, aic, aicc and bic.

    Definition Classes
    SARIMAForecaster
  15. def fitLabel: Seq[String]

    Return the labels for the fit.

    Return the labels for the fit.

    Definition Classes
    SARIMAForecaster
  16. 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
  17. final def flaw(method: String, message: String): Unit
    Definition Classes
    Error
  18. def forecast(h: Int = 1, xxreg_f: MatriD = null): VectoD

    Produce n-steps-ahead forecast for SARIMA models.

    Produce n-steps-ahead forecast for SARIMA models.

    h

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

    xxreg_f

    future values of external regressors may be guesses based on the past (e.g., past mean)

    See also

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

  19. def forecast(h: Int): VectoD

    Produce h-steps-ahead forecast for SARIMA models.

    Produce h-steps-ahead forecast for SARIMA models.

    h

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

    Definition Classes
    SARIMAForecaster
    See also

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

  20. def forecast(): VectoD

    Produce forecasts for one step ahead into the future

    Produce forecasts for one step ahead into the future

    Definition Classes
    Forecaster
  21. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. def getParam: (Int, Int, Int, Int, Int, Int, Int)

    Get the orders of this SARIMA model.

  23. def getXreg(xxreg: MatriD, dim1: Int = n): MatriD

    Processing the external regressors such as differencing and adding a column of one's.

    Processing the external regressors such as differencing and adding a column of one's.

    xxreg

    the external regressors to be processed

    dim1

    the correct number of rows of 'xreg' after applying differencing

  24. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  25. val index_rSq: Int
    Definition Classes
    Forecaster
  26. def initKalman(φ: VectoD = φ, θ: VectoD = θ): (VectoD, MatriD, MatriD, MatriD, MatriD)

    Initialize various vector and matrices to be used for Kalman Filter.

    Initialize various vector and matrices to be used for Kalman Filter. Current only support undifferenced, non-seasonal time series.

    φ

    the AR coefficients

    θ

    the MA coefficients

    See also

    www.stat.berkeley.edu/classes/s244/as154.pdf

  27. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  28. val mae: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  29. val mape: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  30. val mse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  31. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  32. def nll(input: VectoD): Double

    The negative log-likelihood function to be minimized.

    The negative log-likelihood function to be minimized.

    input

    the input parameter vector

    See also

    stats.stackexchange.com/questions/77663/arima-estimation-by-hand

    spia.uga.edu/faculty_pages/monogan/teaching/ts/Barima.pdf

  33. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  35. 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

  36. def predict(): VectoD

    Return the vector of fitted values on the training data.

    Return the vector of fitted values on the training data.

    Definition Classes
    SARIMAForecaster
  37. val rSq: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  38. val rmse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  39. def setPQ(p_: Int = 0, q_: Int = 0, pp_: Int = 0, qq_: Int = 0): Unit

    Set values for 'p', 'q', 'pp' and 'qq'.

    Set values for 'p', 'q', 'pp' and 'qq'.

    p_

    the order of the AR part of the model

    q_

    the order of the MA part of the model

    pp_

    the order of the Seasonal AR part of the model

    qq_

    the order of the Seasonal MA part of the model

  40. def setTS(y: VectoD, xxreg: MatriD = null): Unit

    Set/change the internal time series.

    Set/change the internal time series. May be used to set the time series to a different time window (typically future when new data become available) in order to produce newer forecast (typically with the new data) without re-training the model for parameters (use existing parameters from previous training).

    y

    the new time series

    xxreg

    the new external regressors

  41. 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

  42. val sse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  43. val ssr: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  44. val sst: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  45. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  46. def toString(): String
    Definition Classes
    AnyRef → Any
  47. def train(): SARIMA

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

    Train/fit an SARIMA model to the times series data. Must call 'SetPQ' first.

    Definition Classes
    SARIMAForecaster
  48. def updateFittedValues(): Double

    Update 'xp', the vector of fitted values; 'e', the vector of errors; ll, aic, aicc and bic.

  49. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  50. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  51. 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