# \donttest{
# Generate example panel data
set.seed(42)
n_time <- 50
n_vars <- 10
# Create correlated predictors with common factor structure
factors <- matrix(rnorm(n_time * 2), n_time, 2)
loadings <- matrix(runif(n_vars * 2, -1, 1), n_vars, 2)
X <- factors %*% t(loadings) + matrix(rnorm(n_time * n_vars, 0, 0.5), n_time, n_vars)
colnames(X) <- paste0("X", 1:n_vars)
# True signal depends on only 3 predictors
true_beta <- c(rep(1, 3), rep(0, 7))
Y <- X %*% true_beta + rnorm(n_time, 0, 0.5)
# Combine into data frame
data <- data.frame(Y = Y, X)
# Run comprehensive analysis
# We pass specific configs to make MCMC very fast just for the example
result <- signal_analysis(
data = data,
y_formula = "Y",
methods = "all",
verbose = TRUE,
# Configuration for speed (CRAN policy < 5s preferred)
filter_config = list(
hpgc_chains = 1,
hpgc_iterations = 50,
hpgc_burnin = 10
),
horseshoe_config = list(
chains = 1,
iter_sampling = 50,
iter_warmup = 10
),
pca_config = list(
n_boot = 50
)
)
# View interpretation
print(result)
# Plot results
plot(result)
# }
Run the code above in your browser using DataLab