View source: R/create_scenario.R
create_scenario | R Documentation |
Constructs confidence regions (hyperellipsoids) for the factor space based on a central MLDFM estimate and a set of subsampled estimates. These regions capture estimation uncertainty and are used to simulate stresses scenarios.
create_scenario(model, subsamples, alpha = 0.95, fpr = FALSE)
model |
An object of class |
subsamples |
A list of |
alpha |
Numeric. Confidence level (level of stress) for the hyperellipsoid (e.g., 0.95). |
fpr |
Logical. If TRUE, uses the Adaptive Threshold Cross-Sectional Robust (FPR) Gamma as in Fresoli, Poncela and Ruiz (2024); otherwise, uses the standard time-varying (NG) Gamma. |
A list of matrices representing the hyperellipsoid points for each time observation.
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)
mldfm_subsampling_result <- mldfm_subsampling(data, blocks = 2,
block_ind = block_ind, global = global,
local = local, n_samples = 100, sample_size = 0.9)
scenario <- create_scenario(mldfm_result, mldfm_subsampling_result,
alpha = 0.95)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.