View source: R/compute_stressed_factors.R
| compute_stressed_factors | R Documentation |
Computes stressed factors.
compute_stressed_factors(
dep_variable,
factors,
ellipsoids,
h = 1,
qtau = 0.05,
direction = c("min", "max")
)
dep_variable |
Numeric vector of length T representing the dependent variable (e.g., GDP growth, inflation). |
factors |
Numeric matrix or data frame of dimension T x r, containing factor estimates. |
ellipsoids |
List of matrices. Each matrix represents a stressed ellipsoid for a given time period. |
h |
Integer (>= 1). Lag order used in the regression (default = 1) |
qtau |
Numeric between 0 and 1. The quantile level used in quantile regression (default = 0.05). |
direction |
Character, either "min" or "max". Determines whether to minimize or maximize |
A numeric matrix of dimension T x r containing the stressed factors for each time period.
set.seed(42)
T <- 100; r <- 3
Y <- rnorm(T)
F <- matrix(rnorm(T * r), T, r)
E <- replicate(T, matrix(rnorm(50 * r), nrow = 50, ncol = r), simplify = FALSE)
stressed_factors <- compute_stressed_factors(Y, F, E, h = 1, qtau = 0.05, direction = "min")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.