compute_fars {FARS} | R Documentation |
Compute Factor Augmented Quantile Regressions and Stressed Quantiles
Description
Performs quantile regressions of a dependent variable on MLDFM-extracted factors. Optionally generates quantile forecasts under stressed scenarios using hyperellipsoids.
Usage
compute_fars(
dep_variable,
factors,
h = 1,
edge = 0.05,
scenario = NULL,
min = TRUE,
QTAU = 0.05
)
Arguments
dep_variable |
A numeric vector representing the dependent variable (e.g., GDP growth, inflation). |
factors |
A matrix of factor estimates from a |
h |
Integer. Forecast horizon (in time steps) for the quantile regression. Default is |
edge |
Numeric. Trimming amount applied to the outermost quantiles (default |
scenario |
Optional list of matrices representing a stressed scenario, as returned by |
min |
Logical. If |
QTAU |
Numeric. Quantile level (default |
Value
A list containing:
Quantiles
Matrix of forecasted quantiles (rows = time, cols = quantile levels).
Strssed_Quantiles
Matrix of stressed scenario quantiles (same format), returned only if
scenario
is provided.Coeff
Matrix of quantile regression coefficients for each quantile.
Std. Error
Matrix of Std. Error for each regression coefficient.
Pvalue
Matrix of p-values for each regression coefficient.
QTAU
The quantile level used to compute stressed factors (if applicable).
Stressed_Factors
Matrix of selected stressed factors (only if
scenario
is provided andQTAU
is set).
Examples
dep_variable <- rnorm(100) # A numeric vector
data <- matrix(rnorm(100*300), nrow = 100, ncol = 300)
block_ind <- c(150, 300) # Defines 2 blocks
global = 1
local <- c(1, 1)
mldfm_result <- mldfm(data, blocks = 2, block_ind = block_ind, global = global , local = local)
fars_result <- compute_fars(dep_variable, mldfm_result$Factors, h = 1, edge = 0.05)