Learn R Programming

dcce (version 0.4.2)

csd_exp: Exponent of Cross-Sectional Dependence

Description

Estimates the exponent of cross-sectional dependence (alpha) using the methods of Bailey, Kapetanios & Pesaran (2016, 2019).

Usage

csd_exp(
  x,
  data = NULL,
  unit_index = NULL,
  time_index = NULL,
  use_residuals = FALSE,
  n_pca = 1L,
  test_size = 0.1,
  tuning = 0.5,
  n_bootstrap = 200L
)

Value

An object of class dcce_csd with elements alpha (estimated exponent), se (standard error), ci (confidence interval), method, N, and T_val.

Arguments

x

Either a numeric vector (variable stacked by unit), a numeric matrix (N x T), or a dcce_fit object (uses residuals).

data

A data.frame containing the panel structure. Required if x is a vector.

unit_index

Character: name of the unit variable in data.

time_index

Character: name of the time variable in data.

use_residuals

Logical: if TRUE, use the BKP (2019) residual method; if FALSE (default), use the BKP (2016) variable method.

n_pca

Integer: number of principal components. Default 1.

test_size

Numeric: significance level for thresholding. Default 0.1.

tuning

Numeric: tuning parameter for residual method threshold. Default 0.5.

n_bootstrap

Integer: bootstrap repetitions for SE (residual method only). Default 200.

Examples

Run this code
set.seed(42)
# Matrix of cross-sectionally dependent data
N <- 20; T_val <- 50
f <- rnorm(T_val)
x <- matrix(NA, N, T_val)
for (i in 1:N) x[i,] <- rnorm(1) * f + rnorm(T_val, sd = 0.5)
result <- csd_exp(x, use_residuals = FALSE)
print(result)

Run the code above in your browser using DataLab