View source: R/create_scenario.R
| create_scenario | R Documentation |
Constructs hyperellipsoids around MLDFM factor estimates using subsampling. These regions capture estimation uncertainty and allow for the simulation of stressed scenarios.
create_scenario(model, subsamples, alpha = 0.95, fpr = FALSE)
model |
An object of class |
subsamples |
An object of class |
alpha |
Numeric. Confidence level for the hyperellipsoids (e.g., 0.95). |
fpr |
Logical. If |
An object of class fars_scenario, which is a list containing:
List of matrices defining the hyperellipsoids at each time.
Matrix of factor estimates (centers of the ellipsoids).
List of covariance matrices used to define the ellipsoids.
Number of time observations.
Number of points used to define each ellipsoid.
Confidence level for the hyperellipsoids.
Function call.
data <- matrix(rnorm(100*300), nrow = 100, ncol = 300)
block_ind <- c(150, 300)
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.