Estimation

MessyTimeSeriesOptim provides a generic ECM algorithm easily adaptable to any model that can be written in a linear state-space form. This algorithm is also compatible with penalised maximum likelihood and penalised quasi maximum likelihood estimation.

ECM algorithm

MessyTimeSeriesOptim.ecmFunction
ecm(estim::EstimSettings)

Run the ECM algorithm in Pellegrino (2022).

Arguments

  • estim: settings used for the estimation
  • output_sspace_data: Optional argument. If specified, it is used as the output state space data. Otherwise, estim.Y is used instead.

References

Pellegrino (2022)

source

EstimSettings

MessyTimeSeriesOptim provides the following EstimSettings subtypes.

Dynamic factor models

MessyTimeSeriesOptim.DFMSettingsType
DFMSettings(...)

Define an immutable structure used to initialise the estimation routine for a DFM.

Arguments

  • Y: observed measurements (nxT)
  • n: Number of series
  • T: Number of observations
  • lags: Order of the autoregressive polynomial of each common cycle
  • n_trends: Number of trends
  • n_drifts: Number of drifts
  • n_cycles: Number of cycles
  • n_non_stationary: ntrends + ndrifts
  • m: nnonstationary + n_cycles*lags + n
  • trends_skeleton: The basic structure for the trends loadings (or nothing)
  • cycles_skeleton: The basic structure for the cycles loadings (or nothing)
  • drifts_selection: BitArray{1} identifying which trend has a drift to estimate (or nothing)
  • trends_free_params: BitArray{2} identifying the trend loadings to estimate (or nothing)
  • cycles_free_params: BitArray{2} identifying the cycle loadings to estimate (or nothing)
  • λ: 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)
  • Γ: Diagonal matrix used to input the hyperparameters in the penalty computation for the common cycles
  • Γ_idio: Diagonal matrix used to input the hyperparameters in the penalty computation for the idiosyncratic cycles
  • Γ_extended: Diagonal matrix used to input the hyperparameters in the estimation
  • ε: Small number (default: 1e-4)
  • tol: tolerance used to check convergence (default: 1e-4)
  • max_iter: maximum number of iterations for the estimation algorithm (default: 1000)
  • prerun: number of iterations prior the actual estimation algorithm (default: 2)
  • check_quantile: check the quantile of the relative change of the parameters for convergence purposes (default: false)
  • verb: Verbose output (default: true)
source

Vector autoregressions

MessyTimeSeriesOptim.VARSettingsType
VARSettings(...)

Define an immutable structure used to initialise the estimation routine for VAR(q) models.

Arguments

  • Y: observed measurements (nxT)
  • n: Number of series
  • T: Number of observations
  • q: Order of the autoregressive polynomial
  • nq: n*q
  • m: n*q
  • λ: 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)
  • Γ: Diagonal matrix used to input the hyperparameters in the estimation - see Pellegrino (2022) for details
  • ε: Small number (default: 1e-4)
  • tol: tolerance used to check convergence (default: 1e-4)
  • max_iter: maximum number of iterations for the estimation algorithm (default: 1000)
  • prerun: number of iterations prior the actual estimation algorithm (default: 2)
  • check_quantile: check the quantile of the relative change of the parameters for convergence purposes (default: false)
  • verb: Verbose output (default: true)
source

Vector moving averages

MessyTimeSeriesOptim.VMASettingsType
VMASettings(...)

Define an immutable structure used to initialise the estimation routine for VMA(r) models.

Arguments

  • Y: observed measurements (nxT)
  • n: Number of series
  • T: Number of observations
  • r: Order of the moving average polynomial
  • nr: n*r
  • m: nr+n*1_{q=0}
  • λ: 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)
  • Γ: Diagonal matrix used to input the hyperparameters in the estimation - see Pellegrino (2022) for details
  • ε: Small number (default: 1e-4)
  • tol: tolerance used to check convergence (default: 1e-4)
  • max_iter: maximum number of iterations for the estimation algorithm (default: 1000)
  • prerun: number of iterations prior the actual estimation algorithm (default: 2)
  • check_quantile: check the quantile of the relative change of the parameters for convergence purposes (default: false)
  • verb: Verbose output (default: true)
source