sim_DGP {BTtest}R Documentation

Simulate a Nonstationary Panel With Common Trends

Description

Simulate a nonstationary panel as laid out in Barigozzi & Trapani (2022, sec. 5).

Usage

sim_DGP(
  N = 100,
  n_Periods = 200,
  drift = TRUE,
  drift_I1 = TRUE,
  r_I1 = 2,
  r_I0 = 1,
  return_factor = FALSE
)

Arguments

N

the number of cross-sectional units.

n_Periods

the number of simulated time periods.

drift

logical. If TRUE, a linear trend is included (corresponding to both d_1 = 1 and r_1 = 1).

drift_I1

logical. If TRUE, an I(1) factor moves around the linear trend. Else an I(0) factor (corresponding to d_2 = 1).

r_I1

the total number of non zero-mean I(1) factors (corresponding to r_2 + r_1 * d_2).

r_I0

the total number of non zero-mean I(0) factors (corresponding to r_3 + r_1 * (1 - d_2)).

return_factor

logical. If TRUE, the factor matrix is returned. Else the simulated observations. Default is FALSE.

Details

For further details on the construction of the DGP, see Barigozzi & Trapani (2022, sec. 5).

Value

A (T x N) matrix of simulated observations. If return_factor = TRUE, a (N x r) matrix of factors.

Author(s)

Paul Haimerl

References

Barigozzi, M., & Trapani, L. (2022). Testing for common trends in nonstationary large datasets. Journal of Business & Economic Statistics, 40(3), 1107-1122. doi:10.1080/07350015.2021.1901719

Examples

# Simulate a panel containing a factor with a linear drift (r_1 = d_1 = 1) and I(1) process
# (d_2 = 1), one zero-mean I(1) factor (r_2 = 1) and two zero-mean I(0) factors (r_3 = 2)
X <- sim_DGP(N = 100, n_Periods = 200, drift = TRUE, drift_I1 = TRUE, r_I1 = 2, r_I0 = 2)

# Simulate a panel containing only 3 common zero-mean I(0) factor (r_1 = 0, r_2 = 0, r_3 = 3)
X <- sim_DGP(N = 100, n_Periods = 200, drift = FALSE, drift_I1 = TRUE, r_I1 = 0, r_I0 = 3)

[Package BTtest version 0.10.2 Index]