create_scenario: Create Stressed Scenarios

View source: R/create_scenario.R

create_scenarioR Documentation

Create Stressed Scenarios

Description

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.

Usage

create_scenario(model, subsamples, alpha = 0.95, fpr = FALSE)

Arguments

model

An object of class mldfm, containing the factor estimates.

subsamples

A list of mldfm objects returned from mldfm_subsampling.

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.

Value

A list of matrices representing the hyperellipsoid points for each time observation.

Examples


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)



FARS documentation built on Aug. 8, 2025, 7:33 p.m.