| Title: | Estimation and Inference for High-Dimensional Panel Data Models with Interactive Fixed Effects |
|---|---|
| Description: | Estimation and inference for panel data models with interactive fixed effects. The methods cover i) the linear specification of Ruecker, M., Vogt, M., Linton, O. and Walsh, C. (2025) "Estimation and Inference in High-Dimensional Panel Data Models with Interactive Fixed Effects" <doi:10.3982/QE2308>, and ii) the dictionary design of Ruecker, M., Vogt, M. and Linton, O. (2026) "High-Dimensional Panel Data Models with Interactive Fixed Effects: Beyond the Linear Case" <doi:10.48550/arXiv.2608.02055>. |
| Authors: | Maximilian Ruecker [aut, cre], Michael Vogt [aut], Oliver Linton [aut], Christopher Walsh [aut] |
| Maintainer: | Maximilian Ruecker <[email protected]> |
| License: | GPL (>= 2) |
| Version: | 0.1.0 |
| Built: | 2026-09-16 09:57:57 UTC |
| Source: | https://github.com/rueckerm/hdcce |
A balanced panel simulated with generate_data from the design
of the simulation study in Rücker et al. (2025), used to
illustrate hdcce_estimator. The panel is sorted such that the
first obs_T = 20 rows belong to unit 1, the next 20 to unit 2, etc.
data_estimationdata_estimation
A list with two components:
numeric matrix of dimension 400 x 61 containing the regressors.
numeric vector of length 400 containing the response.
Simulated with generate_data(obs_N = 20, obs_T = 20, p = 61,
mu = rep(1, 63), RHO = 0.25) after set.seed(2024).
Rücker, M., Vogt, M., Linton, O. and Walsh, C. (2025). Estimation and inference in high-dimensional panel data models with interactive fixed effects. Quantitative Economics, 16(4), 1457–1509. doi:10.3982/QE2308.
Rücker, M., Vogt, M. and Linton, O. (2026) "High-Dimensional Panel Data Models with Interactive Fixed Effects: Beyond the Linear Case" https://arxiv.org/pdf/2608.02055.
As data_estimation, but with three response vectors differing
in the coefficient of the first regressor; used to illustrate
hdcce_inference.
data_inferencedata_inference
A list with two components:
numeric matrix of dimension 400 x 61 containing the regressors.
numeric matrix of dimension 400 x 3; column is generated
with coefficient of the first regressor equal to c** = 0, 0.1 and 0.2.
Simulated with generate_data(obs_N = 20, obs_T = 20, p = 61,
mu = rep(1, 63), RHO = 0.25) after set.seed(2024).
Rücker, M., Vogt, M., Linton, O. and Walsh, C. (2025). Estimation and inference in high-dimensional panel data models with interactive fixed effects. Quantitative Economics, 16(4), 1457–1509. doi:10.3982/QE2308
Rücker, M., Vogt, M. and Linton, O. (2026) "High-Dimensional Panel Data Models with Interactive Fixed Effects: Beyond the Linear Case" <https://arxiv.org/pdf/2608.02055>.
generate_data simulates panel data as in the simulation section of
Rücker et al. (2025). It was used to create the data sets
data_estimation and data_inference shipped with
the package.
generate_data(obs_N, obs_T, p, mu, RHO)generate_data(obs_N, obs_T, p, mu, RHO)
obs_N |
Number of cross-section units. |
obs_T |
Number of time periods. |
p |
Number of regressors/covariates. |
mu |
Vector for individual loadings. |
RHO |
Pairwise correlation coefficient of the regressors. |
List containing the balanced panel data for estimation (data_estimation) and inference (data_inference). data_estimation$y contains the dependent variables and data_estimation$x the regressors. data_inference is in the same spirit with the minor difference that data_inference$y has three columns (one for each signal c** = 0, 0.1, 0.2). In both cases, the panels are sorted such that first T observations are those for unit 1, followed by the T observations for unit 2, etc.
Rücker, M., Vogt, M., Linton, O. and Walsh, C. (2025). Estimation and inference in high-dimensional panel data models with interactive fixed effects. Quantitative Economics, 16(4), 1457–1509. doi:10.3982/QE2308.
Rücker, M., Vogt, M. and Linton, O. (2026) "High-Dimensional Panel Data Models with Interactive Fixed Effects: Beyond the Linear Case" https://arxiv.org/pdf/2608.02055.
# Simulate an example data set with # N = 20, T = 20, RHO = 0.25, p = 61 #----------------------------------------------------------------------------- # Set the parameters #----------------------------------------------------------------------------- # Set the number of cross-sections, time periods obs_N <- 20 obs_T <- 20 p <- 61 # Specify the pairwise correlation among the regressors RHO <- 0.25 # Specify the mean for the factor loadings mu <- c(1, 1, 1, rep(1, (p-1))) # Simulate the data set.seed(2025) sim <- generate_data(obs_N = obs_N, obs_T = obs_T, p, mu = mu, RHO = RHO) dim(sim$data_estimation$x) dim(sim$data_inference$y) # one column per signal c** = 0, 0.1, 0.2# Simulate an example data set with # N = 20, T = 20, RHO = 0.25, p = 61 #----------------------------------------------------------------------------- # Set the parameters #----------------------------------------------------------------------------- # Set the number of cross-sections, time periods obs_N <- 20 obs_T <- 20 p <- 61 # Specify the pairwise correlation among the regressors RHO <- 0.25 # Specify the mean for the factor loadings mu <- c(1, 1, 1, rep(1, (p-1))) # Simulate the data set.seed(2025) sim <- generate_data(obs_N = obs_N, obs_T = obs_T, p, mu = mu, RHO = RHO) dim(sim$data_estimation$x) dim(sim$data_inference$y) # one column per signal c** = 0, 0.1, 0.2
hdcce_estimator fits (i) the linear HD-CCE estimator of Rücker et al.
(2025), or (ii) the HD-CCE estimator for a parametric additive (dictionary)
design as in Rücker et al. (2026), when dictionaries is supplied.
hdcce_estimator( data, obs_N, obs_T, dictionaries = NULL, TRUNC = 0.01, NFACTORS = NULL, variant = c("Lasso", "LS"), lambda = NULL, NFOLDS = 10, foldid = NULL, scree_plot = FALSE, standardize = TRUE )hdcce_estimator( data, obs_N, obs_T, dictionaries = NULL, TRUNC = 0.01, NFACTORS = NULL, variant = c("Lasso", "LS"), lambda = NULL, NFOLDS = 10, foldid = NULL, scree_plot = FALSE, standardize = TRUE )
data |
List containing the balanced panel data with |
obs_N, obs_T
|
The number of cross-section units ( |
dictionaries |
Either |
TRUNC |
The truncation parameter tau used to estimate the number of factors. Default is 0.01. |
NFACTORS |
Allows to set the number of factors used in estimation. Default is NULL, so that the data driven choice with TRUNC is used. |
variant |
Either |
lambda |
User specified lambda grid, on the scale of the penalised criterion in the paper (see Details). |
NFOLDS |
The number of folds (partitioned along the cross-section) used
for cross-validation. Default is 10. Fold size can vary by one if
|
foldid |
Integer vector ( |
scree_plot |
Logical; whether a scree plot of the eigendecomposition of
|
standardize |
Logical; whether |
The criterion in the paper is
,
whereas glmnet minimises
.
The two penalties are related by . Both the
lambda argument and the returned Lambda are on the scale of
the paper.
A list with
The coefficient estimates. A numeric vector, except when a
lambda grid is supplied, in which case a matrix with one column per penalty.
The estimated number of factors, or NFACTORS if set.
The penalty selected by cross-validation, on the scale of the
paper; the supplied grid if lambda was given; NULL for
variant = "LS".
The normalised eigenvalues used to determine
K_hat.
The computed projection matrix
Pi_hat.
Either "linear" or "dictionary".
The matched call.
Rücker, M., Vogt, M., Linton, O. and Walsh, C. (2025). Estimation and inference in high-dimensional panel data models with interactive fixed effects. Quantitative Economics, 16(4), 1457–1509. doi:10.3982/QE2308
Rücker, M., Vogt, M. and Linton, O. (2026). High-dimensional panel data models with interactive fixed effects: beyond the linear case. https://arxiv.org/abs/2608.02055
data("data_estimation") obs_N <- 20 obs_T <- 20 fit <- hdcce_estimator(data = data_estimation, obs_N = obs_N, obs_T = obs_T) fit$K_hat head(fit$coefs, 10)data("data_estimation") obs_N <- 20 obs_T <- 20 fit <- hdcce_estimator(data = data_estimation, obs_N = obs_N, obs_T = obs_T) fit$K_hat head(fit$coefs, 10)
hdcce_inference performs high-dimensional inference with either
(i) the desparsified HD-CCE estimator of Rücker et al. (2025), giving
confidence intervals for individual coefficients, or (ii) the max-type
significance test of Rücker et al. (2026) for the null that a covariate has
no effect in the parametric additive model, when a dictionary is supplied.
hdcce_inference( data, obs_N, obs_T, COEF_INDEX_VEC, dictionaries = NULL, TRUNC = 0.01, NFACTORS = NULL, NFOLDS = 10, foldid = NULL, alpha = c(0.01, 0.05, 0.1), HAC = 2, standardize = TRUE, s_rule = "lambda.1se", kernel = "epanechnikov", C = NULL, QUANT = 0.9, h = NULL, B = 5000 )hdcce_inference( data, obs_N, obs_T, COEF_INDEX_VEC, dictionaries = NULL, TRUNC = 0.01, NFACTORS = NULL, NFOLDS = 10, foldid = NULL, alpha = c(0.01, 0.05, 0.1), HAC = 2, standardize = TRUE, s_rule = "lambda.1se", kernel = "epanechnikov", C = NULL, QUANT = 0.9, h = NULL, B = 5000 )
data |
List containing the balanced panel data with |
obs_N, obs_T
|
The number of cross-section units ( |
COEF_INDEX_VEC |
Indices of the regressors to be tested. |
dictionaries |
Either |
TRUNC |
The truncation parameter tau used to estimate the number of factors. Default is 0.01. |
NFACTORS |
Allows to set the number of factors used in estimation. Default is NULL, so that the data driven choice with TRUNC is used. |
NFOLDS |
Number of folds for cross-validation in |
foldid |
Integer vector ( |
alpha |
Vector of significance levels. |
HAC |
Integer 1, 2 or 3, selecting the homoscedastic, heteroscedasticity robust, or HAC variance estimator. Only used in the linear case. |
standardize |
Logical; whether |
s_rule |
Either |
kernel |
Kernel with support |
C |
Half-width of the region of locations scanned by the test, in the
units of the nodewise residuals: the statistic is maximised over
|
QUANT |
Quantile used for the data-driven choice of |
h |
Bandwidth of the kernel weights, in the same units as |
B |
Number of Monte Carlo draws for the Gaussian coupling. |
The grid of locations is
, so that the supports of the kernel weights are disjoint and the
number of locations is
A list with components results (a list with one entry per
element of COEF_INDEX_VEC, named by the index), alpha,
obs_N, obs_T, type and call. Each entry of
results is a list with
Desparsified estimate; NULL in the dictionary case.
Estimated standard error; NULL in the dictionary case.
z-statistic for H0: beta_j = 0, or the max-type statistic in the dictionary case..
Critical value for each level in alpha.
Two-sided normal p-value, or Monte Carlo p-value in the dictionary case..
Logical, one entry per level in alpha.
Confidence interval per level; NULL in the
dictionary case.
Data frame with the grid of locations, the corresponding
Psi_w and the number of residuals in each bump; NULL in the
linear case.
Estimated number of factors and error standard deviation.
Rücker, M., Vogt, M., Linton, O. and Walsh, C. (2025). Estimation and inference in high-dimensional panel data models with interactive fixed effects. Quantitative Economics, 16(4), 1457–1509. doi:10.3982/QE2308
Rücker, M., Vogt, M. and Linton, O. (2026). High-dimensional panel data models with interactive fixed effects: beyond the linear case. https://arxiv.org/abs/2608.02055
data("data_inference") obs_N <- 20 obs_T <- 20 dat <- list(x = data_inference$x, y = data_inference$y[, 1]) fit <- hdcce_inference(dat, obs_N, obs_T, COEF_INDEX_VEC = 1) fit$results[["1"]]$confidence_banddata("data_inference") obs_N <- 20 obs_T <- 20 dat <- list(x = data_inference$x, y = data_inference$y[, 1]) fit <- hdcce_inference(dat, obs_N, obs_T, COEF_INDEX_VEC = 1) fit$results[["1"]]$confidence_band