The RandomWalk_Star class is used to make an array of random walk models, e.g., one for each variable in a multi-variate time series.
Value parameters
- fname
-
the feature/variable names
- hh
-
the maximum forecasting horizon (h = 1 to hh)
- hparam
-
the hyper-parameters (none => use null)
- tRng
-
the time range, if relevant (time index may suffice)
- y
-
the response/output matrix (multi-variate time series data)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
trait NoSubModelstrait Forecasttrait Modeltrait ForecastTensorclass Diagnosertrait Fittrait FitMclass Objecttrait Matchableclass AnyShow all
Members list
Value members
Concrete methods
For each model, forecast values for all y_.dim time points and all horizons (1 through hh-steps ahead). Record these in the FORECAST TENSOR yf.
For each model, forecast values for all y_.dim time points and all horizons (1 through hh-steps ahead). Record these in the FORECAST TENSOR yf.
Value parameters
- y_
-
the actual values to use in making forecasts
Attributes
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
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
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.
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
For each model, use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TRAINING SET (tr) and a TESTING SET (te). as follows: [ <-- tr_size --> | <-- te_size --> ] Record the forecasted values in the FORECAST TENSOR yf.
For each model, use rolling-validation to compute test Quality of Fit (QoF) measures by dividing the dataset into a TRAINING SET (tr) and a TESTING SET (te). as follows: [ <-- tr_size --> | <-- te_size --> ] Record the forecasted values in the FORECAST TENSOR yf.
Value parameters
- growing
-
whether the training grows as it roll or kepps a fixed size
- rc
-
the retraining cycle (number of forecasts until retraining occurs)
Attributes
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
Train and test each forecasting model y_ = f(y-past) + e and report its QoF and plot its predictions.
Train and test each forecasting model y_ = f(y-past) + e and report its QoF and plot its predictions.
Value parameters
- y_
-
the training/full response/output vector (defaults to full y)
- yy
-
the testing/full response/output vector (defaults to full y)
Attributes
Inherited methods
Make the PREDICTION INTERVAL (PI) lower and upper bound vectors from the point predictions and the interval half widths.
Make the PREDICTION INTERVAL (PI) lower and upper bound vectors from the point predictions and the interval half widths.
Value parameters
- ihw
-
the vector of interval half widths (one for each prediction)
- yp
-
the vector of point predictions (y-hat)
Attributes
- Inherited from:
- Fit
Build a sub-model that is restricted to the given columns of the data matrix. Must be implemented for models that support feature selection. NOT SUPPORTED for this model, so throw an EXCEPTION.
Build a sub-model that is restricted to the given columns of the data matrix. Must be implemented for models that support feature selection. NOT SUPPORTED for this model, so throw an EXCEPTION.
Value parameters
- fname2
-
the variable/feature names for the new model (defaults to null)
- x_cols
-
the columns that the new model is restricted to
Attributes
- Inherited from:
- NoSubModels
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
- Inherited from:
- Forecast
The standard signature for prediction does not apply to time series.
The standard signature for prediction does not apply to time series.
Attributes
- Inherited from:
- Forecast
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)
- yp
-
the predicted response/output vector (test/full)
Attributes
- Definition Classes
- Inherited from:
- Diagnoser
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 TENSOR
- yy
-
the actual response/output matrix over all horizons
Attributes
- Inherited from:
- ForecastTensor
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)
- y_
-
the actual multi-variate time series matrix to use in making forecasts
- yf
-
the entire FORECAST TENSOR
Attributes
- Inherited from:
- ForecastTensor
Diagnose the health of the model by computing the Quality of Fit (QoF) metrics/measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted. This method also includes PREDICTION INTERVAL (PI) metrics/measures.
Diagnose the health of the model by computing the Quality of Fit (QoF) metrics/measures, from the error/residual vector and the predicted & actual responses. For some models the instances may be weighted. This method also includes PREDICTION INTERVAL (PI) metrics/measures.
Value parameters
- low_up
-
the predicted (lower, upper) bounds vectors
- w
-
the weights on the instances (defaults to null)
- y
-
the actual response/output vector to use (test/full)
- yp
-
the point prediction mean/median
- α
-
the significance/nominal level of uncertainty (α) (defaults to 0.1, 10%)
Attributes
- See also
-
otexts.com/fpp2/prediction-intervals.html Note:
wisshould be computed separately as the bounds are matrices. - Inherited from:
- Fit
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the predicted & actual matrix responses (output variable per column). For some models the instances may be weighted.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, from the predicted & actual matrix responses (output variable per column). For some models the instances may be weighted.
Value parameters
- w
-
the weights on the instances (defaults to null)
- yy
-
the actual response/output matrix to use (test/full)
- yyp
-
the predicted response/output matrix (test/full)
Attributes
- See also
-
Regression_WLS - Inherited from:
- Fit
Diagnose the health of the model by computing the Quality of Fit (QoF) measures for both POINT PREDICTIONS and PREDICTION INTERVALS.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures for both POINT PREDICTIONS and PREDICTION INTERVALS.
Value parameters
- iα
-
the index for the main significance level out of the vector α
- low_up
-
the predicted (lower, upper) bounds matrices for various α levels (column for each α level)
- y
-
the given time-series (must be aligned with the interval forecast)
- yp
-
the point prediction mean/median
- α
-
the vector of significance levels (defaults to the K = 11 prediction intervals used by the CDC Forecast Hub)
Attributes
- Inherited from:
- Fit
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, specifically for the weighted interval score that allows using custom α levels.
Diagnose the health of the model by computing the Quality of Fit (QoF) measures, specifically for the weighted interval score that allows using custom α levels.
Value parameters
- low_up
-
the predicted (lower, upper) bounds matrices for various α levels (column for each α level)
- y
-
the given time-series (must be aligned with the interval forecast)
- yp
-
the point prediction mean/median
- α
-
the vector of significance levels (defaults to the K = 11 prediction intervals used by the CDC Forecast Hub)
Attributes
- Inherited from:
- Fit
Return the diagonalized version of the forecst tensor, i.e., for each of the j-th forecast matrices 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.
Return the diagonalized version of the forecst tensor, i.e., for each of the j-th forecast matrices 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.
Value parameters
- yf
-
the current forecast tensor
Attributes
- Inherited from:
- ForecastTensor
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
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
Return the Quality of Fit (QoF) measures corresponding to the labels given. 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). Override to add more quality of fit measures.
Return the Quality of Fit (QoF) measures corresponding to the labels given. 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). Override to add more quality of fit measures.
Attributes
- Definition Classes
- Inherited from:
- Fit
Return the best model found from feature selection.
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
- Inherited from:
- Forecast
Return the data matrix x concatenated with response vector y.
Return the y-transformation.
Return the used response matrix y, if needed.
Return the used response matrix y, if needed.
Attributes
- See also
-
neuralnet.PredictorMV - Inherited from:
- Model
Return the help string that describes the Quality of Fit (QoF) measures provided by the Fit trait. Override to correspond to fitLabel.
The log-likelihood function times -2. Override as needed.
The log-likelihood function times -2. Override as needed.
Value parameters
- ms
-
raw Mean Squared Error
- s2
-
MLE estimate of the population variance of the residuals
Attributes
- See also
- Inherited from:
- Fit
Make the full FORECAST TENSOR where (for each sheet j) 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 TENSOR where (for each sheet j) 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 multi-variate times values to use in making forecasts
Attributes
- Inherited from:
- ForecastTensor
Models need to provide a means for updating the Degrees of Freedom (DF). Note: Degrees of Freedom are mainly relevant for full and train, not test.
Models need to provide a means for updating the Degrees of Freedom (DF). Note: Degrees of Freedom are mainly relevant for full and train, not test.
Value parameters
- size
-
the size of dataset (full, train, or test sets)
Attributes
- Inherited from:
- Diagnoser
Get the model name.
Return the mean of the squares for error (sse / df). Must call diagnose first.
Return the mean of the squares for error (sse / df). Must call diagnose first.
Attributes
- Inherited from:
- Fit
The standard signature for prediction does not apply to time series.
The standard signature for prediction does not apply to time series.
Attributes
- Inherited from:
- Forecast
Produce a PREDICTION INTERVAL half width for each prediction yp (y-hat).
Produce a PREDICTION INTERVAL half width for each prediction yp (y-hat).
Value parameters
- df_
-
the error/residual degrees of freedom
- x_
-
the testing/full data/input matrix
- α
-
the significance level α = .1 for TWO TAILS: left tail .05 | 1 - α = .90 | .05 right tail e.g., for AutoMPG, t_crit (385, 0.90) = 1.6488210657096942 t_crit (385, 0.95) = 1.966
Attributes
- See also
-
predictCIntinPredictorstats.stackexchange.com/questions/585660/what-is-the-formula-for-prediction-interval-in-multivariate-case
- Inherited from:
- Fit
Produce a PREDICTION INTERVAL half width for each prediction yp (y-hat) and each significance level.
Produce a PREDICTION INTERVAL half width for each prediction yp (y-hat) and each significance level.
Value parameters
- df_
-
the error/residual degrees of freedom
- x_
-
the testing/full data/input matrix
- α
-
the significance levels to be used (defaults to
Fit.α_)
Attributes
- Inherited from:
- Fit
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
Return the coefficient of determination (R^2). Must call diagnose first.
Return the coefficient of determination (R^2). Must call diagnose first.
Attributes
- Inherited from:
- FitM
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
Fittrait
Attributes
- Inherited from:
- Model
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
Fittrait
Attributes
- Inherited from:
- Model
Reset the degrees of freedom to the new updated values. For some models, the degrees of freedom is not known until after the model is built.
Reset the degrees of freedom to the new updated values. For some models, the degrees of freedom is not known until after the model is built.
Value parameters
- df_update
-
the updated degrees of freedom (regression/model, error)
Attributes
- Inherited from:
- Fit
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
Set the number of data points/elements to skip at the beginning of a time series for purposes of diagnosis or computing a loss function. For In-Sample, the first value (time t = 0) is not forecastable without backcasting.
Set the number of data points/elements to skip at the beginning of a time series for purposes of diagnosis or computing a loss function. For In-Sample, the first value (time t = 0) is not forecastable without backcasting.
Value parameters
- skip
-
skip this many elements at the beginning of the time series
Attributes
- Inherited from:
- Diagnoser
Show the QoF metrics/measures in vector qof.
Show the QoF metrics/measures in vector qof.
Value parameters
- qof
-
the QoF metrics (e.g., for point and interval predictions/forecasts)
Attributes
- Inherited from:
- Fit
Return the sum of the squares for error (sse). Must call diagnose first.
Return the sum of the squares for error (sse). Must call diagnose first.
Attributes
- Inherited from:
- FitM
Compute the sum of squares errors (loss function), assuming the first 'skip' errors are zero.
Compute the sum of squares errors (loss function), assuming the first 'skip' errors are zero.
Value parameters
- y
-
the actual response vector
- yp
-
the predicted response vector (one-step ahead)
Attributes
- Inherited from:
- Diagnoser
Produce a QoF SUMMARY for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). Note: `Fac_Cholesky is used to compute the inverse of xtx.
Produce a QoF SUMMARY for a model with diagnostics for each predictor x_j and the overall Quality of Fit (QoF). Note: `Fac_Cholesky is used to compute the inverse of xtx.
Value parameters
- b
-
the parameters/coefficients for the model
- fname
-
the array of feature/variable names
- vifs
-
the Variance Inflation Factors (VIFs)
- x_
-
the testing/full data/input matrix
Attributes
- Definition Classes
- Inherited from:
- Fit
Get the type of the task performed by model.
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 from:
- Forecast
Inherited fields
The optional reference to an ontological concept