Validation
MessyTimeSeriesOptim has a generic implementation to validate the models in @ref(estimation) when needed. This is done via the function select_hyperparameters.
MessyTimeSeriesOptim.HyperGridMessyTimeSeriesOptim.ValidationSettingsMessyTimeSeriesOptim.select_hyperparameters
Functions
MessyTimeSeriesOptim.select_hyperparameters — Functionselect_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)
Types
MessyTimeSeriesOptim.ValidationSettings — TypeValidationSettings(...)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 seriesT: Number of observationsis_stationary: Boolean valuemodel_struct: DataType identifying the estimation structure to usemodel_args: Tuple with the arguments required to setup the model specified inmodel_struct(irrelevant for VARs and VMAs)model_kwargs: Tuple with the keyword arguments required to setup the model specified inmodel_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 penaltysubsample: 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: ifC(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.
MessyTimeSeriesOptim.HyperGrid — TypeHyperGrid(...)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