VAR

scalation.modeling.forecasting.VAR
object VAR

The VAR object supports regression for Multivariate Time Series data. Given a response matrix y, a predictor matrix x is built that consists of lagged y vectors. Additional future response vectors are built for training. y_t = b dot x where x = [y_{t-1}, y_{t-2}, ... y_{t-lag}].

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
VAR.type

Members list

Value members

Concrete methods

def apply(y: MatrixD, lags: Int, h: Int, intercept: Boolean, hparam: HyperParameter): RegressionMV

Create a RegressionMV object from a response matrix. The input/data matrix x is formed from the lagged y vectors as columns in matrix x.

Create a RegressionMV object from a response matrix. The input/data matrix x is formed from the lagged y vectors as columns in matrix x.

Value parameters

h

the forecasting horizon (1, 2, ... h)

hparam

the hyper-parameters (use Regression.hp for default)

intercept

whether to add a column of all ones to the matrix (intercept)

lags

the maximum lag included (inclusive)

y

the original un-expanded output/response matrix

Attributes

def plotAll(y: MatrixD, yp: MatrixD, name: String): Unit

Plot actual vs. predicted values for all variables (columns of the matrices).

Plot actual vs. predicted values for all variables (columns of the matrices).

Value parameters

name

the name of the model run to produce yp

y

the original un-expanded output/response matrix

yp

the predicted values (one-step ahead forecasts) matrix

Attributes

def rollValidate(mod: PredictorMV & Fit, rc: Int): Unit

Use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TESTING SET (tr) and a TRAINING SET (te) as follows: [ <-- tr_size --> | <-- te_size --> ] This version calls predict for one-step ahead out-of-sample forecasts.

Use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TESTING SET (tr) and a TRAINING SET (te) as follows: [ <-- tr_size --> | <-- te_size --> ] This version calls predict for one-step ahead out-of-sample forecasts.

Value parameters

mod

the forecasting model being used (e.g., VAR)

rc

the retraining cycle (number of forecasts until retraining occurs)

Attributes

See also

RollingValidation

def split_TnT(x: MatrixD, y: MatrixD, ratio: Double): (MatrixD, MatrixD, MatrixD, MatrixD)

Split the x matrix and y matrix into training and testing sets.

Split the x matrix and y matrix into training and testing sets.

Value parameters

ratio

the ratio of the TESTING set to the full dataset (most common 70-30, 80-20)

x

the x data/input matrix

y

the y response/output matrix

Attributes