Packages

class AR extends ForecasterVec

The AR class provides basic time series analysis capabilities for Auto- Regressive 'AR'. In an 'AR(p)' model, 'p' refers to the order of the Auto-Regressive components of the model. AR 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, and 'e' is the noise vector. ------------------------------------------------------------------------------

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

Instance Constructors

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

    t

    the time vector

    y

    the input vector (time series data)

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. var e: VectorD
    Attributes
    protected
    Definition Classes
    ForecasterVec
  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
    ForecasterVecForecaster
  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 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
  15. def fitLabel: Seq[String]

    Return the labels for the fit.

    Return the labels for the fit. Override when necessary.

    Definition Classes
    Forecaster
  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(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.

    Definition Classes
    ARForecaster
  19. def forecast(): VectoD

    Produce forecasts for one step ahead into the future

    Produce forecasts for one step ahead into the future

    Definition Classes
    Forecaster
  20. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  21. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  22. val index_rSq: Int
    Definition Classes
    Forecaster
  23. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  24. val mae: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  25. val mape: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  26. val ml: Int
    Attributes
    protected
    Definition Classes
    ForecasterVec
  27. val mse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  28. val mu: Double
    Attributes
    protected
    Definition Classes
    ForecasterVec
  29. val n: Int
    Attributes
    protected
    Definition Classes
    ForecasterVec
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. var pacf: VectoD
  34. def parameters: VectoD

    Return the parameter vector.

    Return the parameter vector.

    Definition Classes
    ARForecasterVec
  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

    Definition Classes
    ForecasterVec
  36. def predict(): 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.

    Definition Classes
    ARForecaster
  37. val rSq: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  38. val rmse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  39. def setPQ(p_: Int): Unit

    Set value for 'p'.

    Set value for 'p'.

    p_

    the order of the AR part of the model

  40. val sse: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  41. val ssr: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  42. val sst: Double
    Attributes
    protected
    Definition Classes
    Forecaster
  43. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  44. def toString(): String
    Definition Classes
    AnyRef → Any
  45. def train(p_: Int = 1): AR

    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

  46. def train(): AR

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

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

    Definition Classes
    ARForecasterVecForecaster
  47. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  49. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from ForecasterVec

Inherited from Forecaster

Inherited from Error

Inherited from AnyRef

Inherited from Any

Ungrouped