# `causalis.dgp.panel_data_did.base`

## Module Contents

### Classes

`PanelDIDGeneratorConfig` |
`PanelDIDGenerator` | Low-level generator for realistic simultaneous-adoption DID panels.

### API

class causalis.dgp.panel_data_did.base.PanelDIDGeneratorConfig
  n_treated_units: int

    20

  n_control_units: int

    60

  n_pre_periods: int

    24

  n_post_periods: int

    12

  time_start: int

    1

  time_freq: str

    ‘M’

  calendar_start: str

    ‘2021-01’

  treated_prefix: str

    ‘treated_market_’

  control_prefix: str

    ‘control_market_’

  random_state: Optional[int]

    42

  return_panel_data: bool

    True

  outcome_distribution: Literal[gaussian, gamma, poisson]

    ‘gaussian’

  gamma_shape: float

    9.0

  exposure_log_mean: float

    7.1

  exposure_log_std: float

    0.45

  treated_selection_shift: float

    0.12

  common_factor_std_log: float

    0.05

  unit_noise_std_log: float

    0.07

  outcome_noise_std_log: float

    0.06

  gaussian_noise_std: float

    90.0

  rho_common: float

    0.45

  rho_unit: float

    0.35

  seasonality_strength: float

    0.16

  parallel_trend_violation: float

    0.0

  treatment_effect_rate: float

    0.08

  treatment_effect_slope: float

    0.0

  treatment_effect_heterogeneity_std: float

    0.025

class causalis.dgp.panel_data_did.base.PanelDIDGenerator(config: causalis.dgp.panel_data_did.base.PanelDIDGeneratorConfig)

  Low-level generator for realistic simultaneous-adoption DID panels.

  Initialization

  covariate_cols: tuple[str, ...]

    (‘exposure’, ‘avg_order_value’, ‘market_competition’, ‘macro_index’, ‘seasonality_index’)

  cluster_col: str

    ‘region’

  generate(*, return_panel_data: Optional[bool] = None) → Union[pandas.DataFrame, causalis.data_contracts.panel_data_did.PanelDataDID]