ForecastMatrix

scalation.modeling.forecasting.ForecastMatrix
trait ForecastMatrix(y: VectorD, hh: Int, tRng: Range)

The ForecastMatrix trait provides a common framework for holding forecasts over time and multiple horizons.

Value parameters

hh

the maximum forecasting horizon (h = 1 to hh)

tRng

the time vector, if relevant (index as time may suffice)

y

the response vector (time series data)

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class Forecaster
class AR
class ARMA
class ARIMA
class Forecaster_D
class ARX_D
class ARX_Quad_D
class ARX_Symb_D
class ARY_D
class ARX
class ARX_Quad
class ARX_Symb
class ARY
class ARY_Quad
class SARY
class NullModel
class RandomWalk
class RandomWalkS
class TranARY
class TrendModel
Show all

Members list

Value members

Abstract methods

def diagnose(y_: VectorD, yfh: VectorD, w: VectorD): VectorD

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted. For time series, the first few predictions use only part of the model, so may be skipped.

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted. For time series, the first few predictions use only part of the model, so may be skipped.

Value parameters

w

the weights on the instances (defaults to null)

y_

the actual response/output vector to use (test/full)

yfh

the predicted response/output vector (test/full)

Attributes

def mod_resetDF(size: Int): Unit

Models need to provide a means for updating the Degrees of Freedom (DF).

Models need to provide a means for updating the Degrees of Freedom (DF).

Value parameters

size

the size of dataset (full, train, or test)

Attributes

Concrete methods

def diagnoseAll(y_: VectorD, yf: MatrixD, tRng: Range, sft: Int, showYf: Boolean): Unit

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, for all horizons and print the results in a table. For time series, the first few predictions use only part of the model, so may be skipped. The version is for models that perform RECURSIVE multi-horizon forecasting.

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, for all horizons and print the results in a table. For time series, the first few predictions use only part of the model, so may be skipped. The version is for models that perform RECURSIVE multi-horizon forecasting.

Value parameters

rRng

the time range, defaults to null (=> full time range)

sft

the amount of shift for yfh (FIX - ideally unify the code and remove sft)

showYf

the amount of shift for yfh (FIX - ideally unify the code and remove sft)

y_

the actual response/output vector

yf

the entire FORECAST MATRIX

Attributes

def diagnoseAll(yy: MatrixD, yf: MatrixD): Unit

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, for all horizons and print the results in a table. For time series, the first few predictions use only part of the model, so may be skipped. The version is for models that perform DIRECT multi-horizon forecasting.

Diagnose the health of the model by computing the Quality of Fit (QoF) measures, for all horizons and print the results in a table. For time series, the first few predictions use only part of the model, so may be skipped. The version is for models that perform DIRECT multi-horizon forecasting.

Value parameters

yf

the entire FORECAST MATRIX

yy

the actual response/output matrix over all horizons

Attributes

def makeForecastMatrix(y_: VectorD, hh_: Int): MatrixD

Make the full FORECAST MATRIX where the zeroth column holds the actual time series and the last column is its time/time index. Columns 1, 2, ... hh are for h steps ahead forecasts.

Make the full FORECAST MATRIX where the zeroth column holds the actual time series and the last column is its time/time index. Columns 1, 2, ... hh are for h steps ahead forecasts.

Value parameters

hh

the maximum forecasting horizon, number of steps ahead to produce forecasts

y_

the actual time series vector to use in making forecasts

Attributes

def slant(yf: MatrixD): MatrixD

Return the slanted/diagonalized-down version of the forecast matrix where each row is at a fixed time point and, for example, the random walk model simply pushes the values down diagonals. Note unshiftDiag reverses the process. Also reset the last column that holds the time index to 0, 1, 2, 3, ...

Return the slanted/diagonalized-down version of the forecast matrix where each row is at a fixed time point and, for example, the random walk model simply pushes the values down diagonals. Note unshiftDiag reverses the process. Also reset the last column that holds the time index to 0, 1, 2, 3, ...

Value parameters

yf

the current forecast matrix

Attributes