Validation

MessyTimeSeriesOptim has a generic implementation to validate the models in @ref(estimation) when needed. This is done via the function select_hyperparameters.

Functions

MessyTimeSeriesOptim.select_hyperparametersFunction
select_hyperparameters(validation_settings::ValidationSettings, γ_grid::HyperGrid)

Select the tuning hyper-parameters for the elastic-net vector autoregression.

Arguments

  • validation_settings: ValidationSettings struct
  • γ_grid: HyperGrid struct

References

Pellegrino (2022)

source

Types

MessyTimeSeriesOptim.ValidationSettingsType
ValidationSettings(...)

Define an immutable structure used to define the validation settings.

The arguments are two dimensional arrays representing the bounds of the grid for each hyperparameter.

Arguments

  • err_type:
    • 1 In-sample error
    • 2 Out-of-sample error
    • 3 Block jackknife error
    • 4 Artificial jackknife error
  • Y: observed measurements (nxT)
  • n: Number of series
  • T: Number of observations
  • is_stationary: Boolean value
  • model_struct: DataType identifying the estimation structure to use
  • model_args: Tuple with the arguments required to setup the model specified in model_struct (irrelevant for VARs and VMAs)
  • model_kwargs: Tuple with the keyword arguments required to setup the model specified in model_struct (default: nothing)
  • coordinates_params_rescaling: Array of vectors including information on the parameters (if any) that require to be rescaled to match the data standardisation (default: nothing)
  • verb: Verbose output (default: true)
  • verb_estim: Further verbose output (default: false)
  • weights: Weights for the forecast error. standardise_error has priority over weights. (default: ones(n))
  • t0: weight associated to the LASSO component of the elastic-net penalty
  • subsample: number of observations removed in the subsampling process, as a percentage of the original sample size. It is bounded between 0 and 1.
  • max_samples: if C(n*T,d) is large, artificialjackknife would generate `maxsamples` jackknife samples. (used only for the artificial jackknife)
  • log_folder_path: folder to store the log file. When this file is defined then the stdout is redirected to this file.
source
MessyTimeSeriesOptim.HyperGridType
HyperGrid(...)

Define an immutable structure used to define the grid of hyperparameters used in validation(...).

The arguments are two dimensional arrays representing the bounds of the grid for each hyperparameter.

Arguments

  • p: Number of lags
  • λ: overall shrinkage hyper-parameter for the elastic-net penalty
  • α: weight associated to the LASSO component of the elastic-net penalty
  • β: additional shrinkage for distant lags (p>1)
  • draws: number of draws used to construct the grid of candidates
source