com.cloudera.sparkts.models

ARIMAModel

class ARIMAModel extends TimeSeriesModel

Linear Supertypes
TimeSeriesModel, AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. ARIMAModel
  2. TimeSeriesModel
  3. AnyRef
  4. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new ARIMAModel(p: Int, d: Int, q: Int, coefficients: Array[Double], hasIntercept: Boolean = true)

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def addTimeDependentEffects(ts: Vector, destTs: Vector): Vector

    Given a timeseries, apply an ARIMA(p, d, q) model to it.

    Given a timeseries, apply an ARIMA(p, d, q) model to it. We assume that prior MA terms are 0.0 and prior AR terms are equal to the intercept or 0.0 if fit without an intercept

    ts

    Time series of i.i.d. observations.

    returns

    The dest series, representing the application of the model to provided error terms, for convenience.

    Definition Classes
    ARIMAModelTimeSeriesModel
  7. def approxAIC(ts: Vector): Double

    Calculates an approximation to the Akaike Information Criterion (AIC).

    Calculates an approximation to the Akaike Information Criterion (AIC). This is an approximation as we use the conditional likelihood, rather than the exact likelihood. Please see https://en.wikipedia.org/wiki/Akaike_information_criterion for more information on this measure.

    ts

    the timeseries to evaluate under current model

    returns

    an approximation to the AIC under the current model

  8. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  9. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  10. val coefficients: Array[Double]

  11. val d: Int

  12. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  13. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. def forecast(ts: Vector, nFuture: Int): Vector

    Provided fitted values for timeseries ts as 1-step ahead forecasts, based on current model parameters, and then provide nFuture periods of forecast.

    Provided fitted values for timeseries ts as 1-step ahead forecasts, based on current model parameters, and then provide nFuture periods of forecast. We assume AR terms prior to the start of the series are equal to the model's intercept term (or 0.0, if fit without and intercept term).Meanwhile, MA terms prior to the start are assumed to be 0.0. If there is differencing, the first d terms come from the original series.

    ts

    Timeseries to use as gold-standard. Each value (i) in the returning series is a 1-step ahead forecast of ts(i). We use the difference between ts(i) - estimate(i) to calculate the error at time i, which is used for the moving average terms.

    nFuture

    Periods in the future to forecast (beyond length of ts)

    returns

    a series consisting of fitted 1-step ahead forecasts for historicals and then nFuture periods of forecasts. Note that in the future values error terms become zero and prior predictions are used for any AR terms.

  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def gradientlogLikelihoodCSSARMA(diffedY: Array[Double]): Array[Double]

    Calculates the gradient for the log likelihood function using CSS Derivation: L(y | \theta) = -\frac{n}{2}log(2\pi\sigma2) - \frac{1}{2\pi}\sum_{i=1}n \epsilon_t2 \\ \sigma2 = \frac{\sum_{i = 1}n \epsilon_t2}{n} \\ \frac{\partial L}{\partial \theta} = -\frac{1}{\sigma2} \sum_{i = 1}n \epsilon_t \frac{\partial \epsilon_t}{\partial \theta} \\ \frac{\partial \epsilon_t}{\partial \theta} = -\frac{\partial \hat{y}}{\partial \theta} \\ \frac{\partial\hat{y}}{\partial c} = 1 + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial c} \\ \frac{\partial\hat{y}}{\partial \theta_{ar_i}} = y_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ar_i}} \\ \frac{\partial\hat{y}}{\partial \theta_{ma_i}} = \epsilon_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ma_i}} \\

    Calculates the gradient for the log likelihood function using CSS Derivation: L(y | \theta) = -\frac{n}{2}log(2\pi\sigma2) - \frac{1}{2\pi}\sum_{i=1}n \epsilon_t2 \\ \sigma2 = \frac{\sum_{i = 1}n \epsilon_t2}{n} \\ \frac{\partial L}{\partial \theta} = -\frac{1}{\sigma2} \sum_{i = 1}n \epsilon_t \frac{\partial \epsilon_t}{\partial \theta} \\ \frac{\partial \epsilon_t}{\partial \theta} = -\frac{\partial \hat{y}}{\partial \theta} \\ \frac{\partial\hat{y}}{\partial c} = 1 + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial c} \\ \frac{\partial\hat{y}}{\partial \theta_{ar_i}} = y_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ar_i}} \\ \frac{\partial\hat{y}}{\partial \theta_{ma_i}} = \epsilon_{t - i} + \phi_{t-q}{t-1}*\frac{\partial \epsilon_{t-q}{t-1}}{\partial \theta_{ma_i}} \\

    diffedY

    array of differenced values

    returns

  18. val hasIntercept: Boolean

  19. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  20. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  21. def isInvertible(): Boolean

    Checks if MA parameters result in an invertible model.

    Checks if MA parameters result in an invertible model. Checks this by solving the roots for 1 + theta_1 * x + theta_2 * x + ... + theta_q * x^q = 0. Please see ARIMAModel.isStationary for more details. Always returns true for models with no MA terms.

    returns

    indicator of whether model's MA parameters are invertible

  22. def isStationary(): Boolean

    Check if the AR parameters result in a stationary model.

    Check if the AR parameters result in a stationary model. This is done by obtaining the roots to the polynomial 1 - phi_1 * x - phi_2 * x2 - ... - phi_p * xp = 0, where phi_i is the corresponding AR parameter. Note that we check the roots, not the inverse of the roots, so we check that they lie outside of the unit circle. Always returns true for models with no AR terms. See http://www.econ.ku.dk/metrics/Econometrics2_05_II/Slides/07_univariatetimeseries_2pp.pdf for more information (specifically slides 23 - 25)

    returns

    indicator of whether model's AR parameters are stationary

  23. def logLikelihoodCSS(y: Vector): Double

    log likelihood based on conditional sum of squares

    log likelihood based on conditional sum of squares

    Source: http://www.nuffield.ox.ac.uk/economics/papers/1997/w6/ma.pdf

    y

    time series

    returns

    log likelihood

  24. def logLikelihoodCSSARMA(diffedY: Array[Double]): Double

    log likelihood based on conditional sum of squares.

    log likelihood based on conditional sum of squares. In contrast to logLikelihoodCSS the array provided should correspond to an already differenced array, so that the function below corresponds to the log likelihood for the ARMA rather than the ARIMA process

    diffedY

    differenced array

    returns

    log likelihood of ARMA

  25. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  26. final def notify(): Unit

    Definition Classes
    AnyRef
  27. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  28. val p: Int

  29. val q: Int

  30. def removeTimeDependentEffects(ts: Vector, destTs: Vector): Vector

    Given a timeseries, assume that it is the result of an ARIMA(p, d, q) process, and apply inverse operations to obtain the original series of underlying errors.

    Given a timeseries, assume that it is the result of an ARIMA(p, d, q) process, and apply inverse operations to obtain the original series of underlying errors. To do so, we assume prior MA terms are 0.0, and prior AR are equal to the model's intercept or 0.0 if fit without an intercept

    ts

    Time series of observations with this model's characteristics.

    returns

    The dest series, representing remaining errors, for convenience.

    Definition Classes
    ARIMAModelTimeSeriesModel
  31. def sample(n: Int, rand: RandomGenerator): Vector

    Sample a series of size n assuming an ARIMA(p, d, q) process.

    Sample a series of size n assuming an ARIMA(p, d, q) process.

    n

    size of sample

    returns

    series reflecting ARIMA(p, d, q) process

  32. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  33. def toString(): String

    Definition Classes
    AnyRef → Any
  34. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  35. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  36. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from TimeSeriesModel

Inherited from AnyRef

Inherited from Any

Ungrouped