compute_fars | R Documentation |
Performs quantile regressions of a dependent variable on MLDFM-extracted factors. Optionally generates quantile forecasts under stressed scenarios using hyperellipsoids.
compute_fars(
dep_variable,
factors,
h = 1,
edge = 0.05,
scenario = NULL,
min = TRUE,
QTAU = 0.05
)
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 |
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 and QTAU
is set).
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.