
Run Complete Lewbel (2012) Monte Carlo Simulation
Source:R/lewbel-monte-carlo.R
run_lewbel_monte_carlo.Rd
Executes a comprehensive Monte Carlo simulation to evaluate the performance of Lewbel's (2012) heteroscedasticity-based identification strategy. This is the main function that orchestrates all simulation components.
Usage
run_lewbel_monte_carlo(
config = NULL,
run_verification = TRUE,
run_bootstrap_demo = TRUE,
run_sample_analysis = TRUE,
run_sensitivity = TRUE,
generate_plots = TRUE,
verbose = TRUE
)
Arguments
- config
If NULL, uses default configuration.
- run_verification
Logical. Whether to run assumption verification (default: TRUE).
- run_bootstrap_demo
Logical. Whether to run bootstrap demonstration (default: TRUE).
- run_sample_analysis
Logical. Whether to run sample size analysis (default: TRUE).
- run_sensitivity
Logical. Whether to run sensitivity analysis (default: TRUE).
- generate_plots
Logical. Whether to generate visualization plots (default: TRUE).
- verbose
Logical. Whether to print progress messages (default: TRUE).
Value
A list containing:
config: Configuration used
results_main: Main simulation results
results_by_n: Sample size analysis results (if run)
results_by_delta: Sensitivity analysis results (if run)
bootstrap_demo: Bootstrap demonstration results (if run)
analysis: Summary analysis
plots: Visualization plots (if generated)
Details
This function runs a complete Monte Carlo evaluation including:
Verification of Lewbel's identifying assumptions
Main simulation comparing OLS vs 2SLS (Lewbel) estimators
Bootstrap demonstration for set identification bounds
Sample size consistency analysis
Sensitivity analysis to heteroscedasticity strength
Comprehensive result analysis and visualization
The simulation uses parallel processing for efficiency and includes proper seed management for reproducibility.
References
Lewbel, A. (2012). Using heteroscedasticity to identify and estimate mismeasured and endogenous regressor models. Journal of Business & Economic Statistics, 30(1), 67-80. doi:10.1080/07350015.2012.643126
Examples
if (FALSE) { # \dontrun{
# Run with default settings
results <- run_lewbel_monte_carlo()
# Run with custom configuration
custom_config <- create_default_config(
num_simulations = 500,
gamma1 = -0.5,
delta_het = 1.5
)
results <- run_lewbel_monte_carlo(custom_config)
# Run only main simulation without extras
results <- run_lewbel_monte_carlo(
run_bootstrap_demo = FALSE,
run_sample_analysis = FALSE,
run_sensitivity = FALSE
)
} # }