Skip to contents

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

Usage

DataForEstimation(
  t0,
  tF,
  Economies,
  N,
  FactorLabels,
  ModelType,
  DataFrequency,
  Macro_FullData,
  Yields_FullData,
  DataConnect = NULL,
  W_type = NULL,
  t_First_Wgvar = NULL,
  t_Last_Wgvar = NULL
)

Arguments

t0

Start date of the sample period in the format yyyy-mm-dd. Day form must be "01"

tF

End date of the sample period in the format yyyy-mm-dd. Day form must be "01".

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"

Macro_FullData

List containing a full set of macroeconomic data.

Yields_FullData

List containing a full set of bond yield data

DataConnect

List containing data for computing bilateral contentedness measures. Default is NULL.

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)

Value

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.

See also

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"

#  Retrieve data from excel files
MacroData  <- Load_Excel_Data(system.file("extdata", "MacroData.xlsx", package = "MultiATSM"))
YieldData <- Load_Excel_Data(system.file("extdata", "YieldsData.xlsx", package = "MultiATSM"))

 DataModel <- DataForEstimation(t0, tF, Economies, N, FactorLabels, ModelType, DataFrequency,
                                MacroData, YieldData)