DataForEstimation function

Retrieves data from Excel and build the database used in the model estimation

Retrieves data from Excel and build the database used in the model estimation

DataForEstimation( t0, tF, Economies, N, FactorLabels, ModelType, DataFrequency, W_type = NULL, t_First_Wgvar = NULL, t_Last_Wgvar = NULL, DataPathMacro = NULL, DataPathYields = NULL, DataPathTrade = NULL )

Arguments

  • t0: Start date of the sample period in the format yyyy-mm-dd.

  • tF: End date of the sample period in the format yyyy-mm-dd.

  • Economies: A character vector containing the names of the economies included in the system.

  • N: Integer. Number of country-specific spanned factors.

  • FactorLabels: String-list based which contains the labels of all the variables present in the model

  • ModelType: String-vector containing the label of the model to be estimated

  • DataFrequency: Character-based-vector. Available options are: "Daily All Days", "Daily Business Days", "Weekly", "Monthly", "Quarterly", "Annually"

  • W_type: Three possibilities:

    • Full Sample: if one wishes ALL weight matrices of each year from which data is available (it may extrapolate the sample period);
    • Sample Mean: if one wishes a SINGLE weight matrix containing the average of weights over of the entire sample period;
    • Some year in particular (e.g. "1998", "2005" ...).
  • t_First_Wgvar: Sample starting date (year)

  • t_Last_Wgvar: Sample last date (year)

  • DataPathMacro: Path of the Excel file containing the macroeconomic data (if any). The default is linked to the excel file present in the package.

  • DataPathYields: Path of the Excel file containing the yields data (if any). The default is linked to the excel file present in the package.

  • DataPathTrade: Path of the Excel file containing the trade data (if any). The default is linked to the excel file present in the package.

Returns

A list containing the

  1. time series of the complete set of bond yields (matrix, J x T or CJ x T);

  2. time series of the complete set risk factors (matrix, K x T);

  3. 'GVARFactors': list of all variables that are used in the estimation of the VARX

    (see e.g. CM_Factors_GVAR file). If the estimated model type is not GVAR-based, then returns NULL.

Examples

DomVar <- c("Eco_Act", "Inflation") GlobalVar <- c("GBC", "CPI_OECD") t0 <- "2006-09-01" tF <- "2019-01-01" Economies <- c("China", "Brazil", "Mexico", "Uruguay", "Russia") N <- 2 ModelType <- "JPS original" FactorLabels <- LabFac(N, DomVar, GlobalVar, Economies, ModelType) DataFrequency <- "Monthly" DataModel <- DataForEstimation(t0, tF, Economies, N, FactorLabels, ModelType, DataFrequency)

See Also

InputsForOpt

  • Maintainer: Rubens Moura
  • License: GPL-2 | GPL-3
  • Last published: 2025-03-24