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. ------------------------------------------------------------------------------
- Alphabetic
- By Inheritance
- SARIMA
- Forecaster
- Error
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
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
-
final
def
!=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
final
def
##(): Int
- Definition Classes
- AnyRef → Any
-
final
def
==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- var acf: VectoD
-
final
def
asInstanceOf[T0]: T0
- Definition Classes
- Any
-
def
clone(): AnyRef
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )
-
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
-
var
e: VectoD
- Attributes
- protected
-
final
def
eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
def
equals(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
-
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
- SARIMA → Forecaster
-
def
f_(z: Double): String
Format a double value.
-
def
finalize(): Unit
- Attributes
- protected[java.lang]
- Definition Classes
- AnyRef
- Annotations
- @throws( classOf[java.lang.Throwable] )
-
def
fit: VectoD
Return the quality of fit.
Return the quality of fit. Additional metrics include loglikelihood, aic, aicc and bic.
- Definition Classes
- SARIMA → Forecaster
-
def
fitLabel: Seq[String]
Return the labels for the fit.
Return the labels for the fit.
- Definition Classes
- SARIMA → Forecaster
-
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
-
final
def
flaw(method: String, message: String): Unit
- Definition Classes
- Error
-
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
-
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
- SARIMA → Forecaster
- See also
ams.sunysb.edu/~zhu/ams586/Forecasting.pdf
-
def
forecast(): VectoD
Produce forecasts for one step ahead into the future
Produce forecasts for one step ahead into the future
- Definition Classes
- Forecaster
-
final
def
getClass(): Class[_]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
def
getParam: (Int, Int, Int, Int, Int, Int, Int)
Get the orders of this SARIMA model.
-
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
-
def
hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
-
val
index_rSq: Int
- Definition Classes
- Forecaster
-
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
-
final
def
isInstanceOf[T0]: Boolean
- Definition Classes
- Any
-
val
mae: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
mape: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
mse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
final
def
ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
-
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
-
final
def
notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
final
def
notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
-
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
-
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
- SARIMA → Forecaster
-
val
rSq: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
rmse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
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
-
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
-
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
-
val
sse: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
ssr: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
val
sst: Double
- Attributes
- protected
- Definition Classes
- Forecaster
-
final
def
synchronized[T0](arg0: ⇒ T0): T0
- Definition Classes
- AnyRef
-
def
toString(): String
- Definition Classes
- AnyRef → Any
-
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
- SARIMA → Forecaster
-
def
updateFittedValues(): Double
Update 'xp', the vector of fitted values; 'e', the vector of errors; ll, aic, aicc and bic.
-
final
def
wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws( ... )
-
final
def
wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @throws( ... )