Forecast

scalation.modeling.forecasting.Forecast
trait Forecast extends Model

The Forecast trait serves a minimal adpater of Model to the Forecast task. Most of implementation is in the Forecaster abstract class below.

Attributes

Graph
Supertypes
trait Model
class Object
trait Matchable
class Any
Known subtypes
class AR_Star
class Forecaster
class AR
class ARMA
class Forecaster_D
class ARX_D
class NARX_SR_D
class ARX_Quad_D
class ARX_SR_D
class ARY_D
class ARX
class ARX_Quad
class ARX_SR
class ARY
class ARY_Quad
class SARY
class NullModel
class RandomWalk
class RandomWalkS
class TrendModel
Show all

Members list

Value members

Concrete methods

def cap: Int

Return the maximum lag used by the model (its capacity to look into the past). Models that use more than one past value to make predictions/forecasts must override this method, e.g., ARMA (2, 3) should set the cap to max(p, q) = 3.

Return the maximum lag used by the model (its capacity to look into the past). Models that use more than one past value to make predictions/forecasts must override this method, e.g., ARMA (2, 3) should set the cap to max(p, q) = 3.

Attributes

def crossValidate(k: Int, rando: Boolean): Array[Statistic]

The standard signature for prediction does not apply to time series.

The standard signature for prediction does not apply to time series.

Attributes

def getFname: Array[String]

Return the feature/variable names. Model that use x should override.

Return the feature/variable names. Model that use x should override.

Attributes

def getX: MatrixD

Return the used data/input matrix. Model that use x should override.

Return the used data/input matrix. Model that use x should override.

Attributes

def predict(z: VectorD): Double

The standard signature for prediction does not apply to time series.

The standard signature for prediction does not apply to time series.

Attributes

def train(x_null: MatrixD, y_: VectorD): Unit

Given a time series y_, train the forecasting function y_ = f(lags (y_)) + e, where f(lags (y_)) is a function of the lagged values of y_, by fitting its parameters.

Given a time series y_, train the forecasting function y_ = f(lags (y_)) + e, where f(lags (y_)) is a function of the lagged values of y_, by fitting its parameters.

Value parameters

x_null

the data/input matrix (ignored, pass null)

y_

the testing/full response/output vector (e.g., full y)

Attributes

Inherited methods

def equation: String

Print the model prediction equation in readable form. Override per model.

Print the model prediction equation in readable form. Override per model.

Attributes

Inherited from:
Model
def equationLaTeX: String

Print the model prediction equation in LaTex form. Override per model.

Print the model prediction equation in LaTex form. Override per model.

Attributes

Inherited from:
Model
def getXy: MatrixD

Return the data matrix x concatenated with response vector y.

Return the data matrix x concatenated with response vector y.

Attributes

Inherited from:
Model
def getYY: MatrixD

Return the used response matrix y, if needed.

Return the used response matrix y, if needed.

Attributes

See also

neuralnet.PredictorMV

Inherited from:
Model
inline def modelName: String

Get the model name.

Get the model name.

Attributes

Inherited from:
Model
def qof2Stat(qof: VectorD): Array[Statistic]

Convert QoF results into an array (of size 1) of Statistic for compatibility with the crossValidate method.

Convert QoF results into an array (of size 1) of Statistic for compatibility with the crossValidate method.

Value parameters

qof

the Quality of Fit (QoF) results

Attributes

Inherited from:
Model
def report(ftMat: MatrixD): String

Return a basic report on a trained and tested multi-variate model.

Return a basic report on a trained and tested multi-variate model.

Value parameters

ftMat

the matrix of qof values produced by the Fit trait

Attributes

Inherited from:
Model
def report(ftVec: VectorD): String

Return a basic report on a trained and tested model.

Return a basic report on a trained and tested model.

Value parameters

ftVec

the vector of qof values produced by the Fit trait

Attributes

Inherited from:
Model
def screen(xy: MatrixD, thr1: Double = ..., thr2: Double = ...)(dep: MatrixD = ...): (MatrixD, VectorI)

Screen the x-columns of matrix xy based on the two thresholds, returning the reduced matrix and the column indices/predictor variables selected.

Screen the x-columns of matrix xy based on the two thresholds, returning the reduced matrix and the column indices/predictor variables selected.

Value parameters

dep

the variable/column dependency measure (defaults to correlation)

thr1

the threshold used to compare the predictor x-columns to the y-column only want variables above some minimal dependency level

thr2

the threshold used to compare the predictor x-columns with each other only want variables below some cut-off dependency/collinearity level

xy

the [ x, y ] combined data-response matrix

Attributes

Inherited from:
Model
inline def taskType: TaskType

Get the type of the task performed by model.

Get the type of the task performed by model.

Attributes

Inherited from:
Model

Inherited and Abstract methods

Return the best model found from feature selection.

Return the best model found from feature selection.

Attributes

Inherited from:
Model
def getY: VectorD

Return the used response vector y. Mainly for derived classes where y is transformed, e.g., TranRegression, ARX.

Return the used response vector y. Mainly for derived classes where y is transformed, e.g., TranRegression, ARX.

Attributes

Inherited from:
Model

Return the model hyper-parameters (if none, return null). Hyper-parameters may be used to regularize parameters or tune the optimizer.

Return the model hyper-parameters (if none, return null). Hyper-parameters may be used to regularize parameters or tune the optimizer.

Attributes

Inherited from:
Model
def inSample_Test(skip: Int = ..., showYp: Boolean = ...): (VectorD, VectorD)

Perform In-Sample Testing, i.e., train and test on the same FULL data set. Good for initial testing and understanding variable relationships. Return the prediction and the Quality of Fit.

Perform In-Sample Testing, i.e., train and test on the same FULL data set. Good for initial testing and understanding variable relationships. Return the prediction and the Quality of Fit.

Value parameters

showYp

whether to show the prediction vector

skip

the number of initial data points to skip (due to insufficient information)

Attributes

Note

May lead to over-fitting for complex models.

Inherited from:
Model

Return the vector of model parameter/coefficient values. Single output models have VectorD parameters, while multi-output models have MatrixD.

Return the vector of model parameter/coefficient values. Single output models have VectorD parameters, while multi-output models have MatrixD.

Attributes

Inherited from:
Model
def test(x_: MatrixD, y_: VectorD): (VectorD, VectorD)

Test/evaluate the model's Quality of Fit (QoF) and return the predictions and QoF vectors. This may include the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model). Extending traits and classes should implement various diagnostics for the test and full (training + test) datasets.

Test/evaluate the model's Quality of Fit (QoF) and return the predictions and QoF vectors. This may include the importance of its parameters (e.g., if 0 is in a parameter's confidence interval, it is a candidate for removal from the model). Extending traits and classes should implement various diagnostics for the test and full (training + test) datasets.

Value parameters

x_

the testing/full data/input matrix (impl. classes may default to x)

y_

the testing/full response/output vector (impl. classes may default to y)

Attributes

Inherited from:
Model
def validate(rando: Boolean = ..., ratio: Double = ...)(idx: IndexedSeq[Int] = ...): (VectorD | MatrixD, VectorD | MatrixD)

Attributes

Inherited from:
Model

Inherited fields

var modelConcept: URI

The optional reference to an ontological concept

The optional reference to an ontological concept

Attributes

Inherited from:
Model