Learn R Programming

bpvars (version 1.0)

specify_panel_data_matrices: R6 Class Representing DataMatricesBVARPANEL

Description

The class DataMatricesBVARPANEL presents the data matrices of dependent variables, \(\mathbf{Y}_c\), and regressors, \(\mathbf{X}_c\), for the Bayesian Panel VAR model for all countries \(c = 1, ..., C\).

Arguments

Public fields

Y

a list with C elements with (T_c + p) x N matrices of dependent variables, \(\mathbf{Y}_c\), possibly with missing observations given by NA.

missing

a list with C elements with T_c x N matrices containing value 1 for missing observation and 0 otherwise.

type

an N character vector with elements set to "rate" or "real" determining the truncation of the predictive density to [0, 100] and (-Inf, Inf) (no truncation) for each of the variables.

exogenous

a list with C elements with (T_c + p) x N matrices of exogenous variables.

Methods


Method new()

Create new data matrices DataMatricesBVARPANEL

Usage

specify_panel_data_matrices$new(
  data,
  p = 1L,
  exogenous = NULL,
  type = rep("real", ncol(data[[1]]))
)

Arguments

data

a list containing (T_c+p)xN matrices with country-specific time series data.

p

a positive integer providing model's autoregressive lag order.

exogenous

a list containing (T_c+p)xd matrices with country-specific of exogenous variables. This matrix should not include a constant term.

type

an N character vector with elements set to "rate" or "real" determining the truncation of the predictive density to [0, 100] and (-Inf, Inf) (no truncation) for each of the variables.

Returns

New data matrices DataMatricesBVARPANEL


Method get_data_matrices()

Returns the data matrices DataMatricesBVARPANEL as a list.

Usage

specify_panel_data_matrices$get_data_matrices()

Examples

data(ilo_dynamic_panel)
YX = specify_panel_data_matrices$new(ilo_dynamic_panel)
YX$get_data_matrices()


Method clone()

The objects of this class are cloneable with this method.

Usage

specify_panel_data_matrices$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.

Examples

Run this code
data(ilo_dynamic_panel)
YX = specify_panel_data_matrices$new(data = ilo_dynamic_panel, p = 4)
length(YX$Y); names(YX$Y)


## ------------------------------------------------
## Method `specify_panel_data_matrices$get_data_matrices`
## ------------------------------------------------

data(ilo_dynamic_panel)
YX = specify_panel_data_matrices$new(ilo_dynamic_panel)
YX$get_data_matrices()

Run the code above in your browser using DataLab