Skip to contents

Creates a dataset based on the triangular model with regime-specific heteroskedasticity following Rigobon (2003). This is a special case of Lewbel's method where heteroskedasticity drivers are discrete regime indicators.

Usage

generate_rigobon_data(n_obs, params, n_x = 1)

Arguments

n_obs

Integer. Sample size.

params

List. Parameters for the data generating process containing:

  • beta1_0, beta1_1: Parameters for first equation

  • beta2_0, beta2_1: Parameters for second equation

  • gamma1: Endogenous parameter (key parameter of interest)

  • alpha1, alpha2: Factor loadings for common factor U

  • regime_probs: Vector of regime probabilities (must sum to 1)

  • sigma2_regimes: Vector of variance multipliers for each regime (length must match regime_probs)

n_x

Integer. Number of exogenous X variables to generate (default: 1).

Value

A data.frame with columns Y1, Y2, epsilon1, epsilon2, regime, and:

  • If n_x = 1: Xk, plus Z1, Z2, ... (one centered dummy per regime)

  • If n_x > 1: X1, X2, ..., plus Z1, Z2, ... (one centered dummy per regime)

Details

The triangular model is: $$Y_1 = \beta_{1,0} + \beta_{1,1}X + \gamma_1 Y_2 + \epsilon_1$$ $$Y_2 = \beta_{2,0} + \beta_{2,1}X + \epsilon_2$$

The error structure follows Rigobon's regime heteroskedasticity: $$\epsilon_1 = \alpha_1 U + V_1$$ $$\epsilon_2 = \alpha_2 U + V_2$$

where V_2 has variance that depends on the regime: $$Var(V_2|regime = s) = \sigma^2_{2,s}$$

References

Rigobon, R. (2003). Identification through heteroskedasticity. Review of Economics and Statistics, 85(4), 777-792. doi:10.1162/003465303772815727

See also

generate_lewbel_data for continuous heteroskedasticity drivers

Examples

if (FALSE) { # \dontrun{
# Two-regime example (e.g., pre/post policy change)
params <- list(
  beta1_0 = 0.5, beta1_1 = 1.5, gamma1 = -0.8,
  beta2_0 = 1.0, beta2_1 = -1.0,
  alpha1 = -0.5, alpha2 = 1.0,
  regime_probs = c(0.4, 0.6), # 40% in regime 1, 60% in regime 2
  sigma2_regimes = c(1.0, 2.5) # Variance is 2.5x higher in regime 2
)
data <- generate_rigobon_data(1000, params)

# Three-regime example
params_3reg <- list(
  beta1_0 = 0.5, beta1_1 = 1.5, gamma1 = -0.8,
  beta2_0 = 1.0, beta2_1 = -1.0,
  alpha1 = -0.5, alpha2 = 1.0,
  regime_probs = c(0.3, 0.4, 0.3),
  sigma2_regimes = c(0.5, 1.0, 2.0)
)
data_3reg <- generate_rigobon_data(1000, params_3reg)
} # }