% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/csd_exp.R
\name{csd_exp}
\alias{csd_exp}
\title{Exponent of Cross-Sectional Dependence}
\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
)
}
\arguments{
\item{x}{Either a numeric vector (variable stacked by unit), a numeric
matrix (N x T), or a \code{dcce_fit} object (uses residuals).}

\item{data}{A data.frame containing the panel structure. Required if
\code{x} is a vector.}

\item{unit_index}{Character: name of the unit variable in \code{data}.}

\item{time_index}{Character: name of the time variable in \code{data}.}

\item{use_residuals}{Logical: if \code{TRUE}, use the BKP (2019) residual method;
if \code{FALSE} (default), use the BKP (2016) variable method.}

\item{n_pca}{Integer: number of principal components. Default 1.}

\item{test_size}{Numeric: significance level for thresholding. Default 0.1.}

\item{tuning}{Numeric: tuning parameter for residual method threshold.
Default 0.5.}

\item{n_bootstrap}{Integer: bootstrap repetitions for SE (residual method
only). Default 200.}
}
\value{
An object of class \code{dcce_csd} with elements \code{alpha} (estimated
exponent), \code{se} (standard error), \code{ci} (confidence interval), \code{method},
\code{N}, and \code{T_val}.
}
\description{
Estimates the exponent of cross-sectional dependence (alpha) using the
methods of Bailey, Kapetanios & Pesaran (2016, 2019).
}
\examples{
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)
}
