SCSPILL
estimators.scspill.SCSPILL(config)Spillover-aware synthetic control estimator (models sar and cd).
The default method="sar" fits the Bayesian spatial-autoregressive model of Sakaguchi and Tagawa (2026); method="cd" fits Cao and Dowd’s all-unit SCM with a known exposure structure and end-of-sample P-test inference (arXiv:1902.07343v3). Both return a :class:SCSPILLResults.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| config | SCSPILLConfig or dict | The estimation configuration; a dict is coerced into :class:scspill.config_models.SCSPILLConfig. |
required |
Examples
from scspill import SCSPILL
from scspill.data import load_california, load_california_cd
panel = load_california()
result = SCSPILL(
{**panel.config_kwargs(), "m_iter": 2000, "burn": 1000, "seed": 42}
).fit()
result.att, result.att_ci
result.rho_hat, result.rho_ci
result.spillover_panel["Nevada"]
cd = SCSPILL(load_california_cd(51).config_kwargs()).fit()
cd.effects_panel.loc[1990, ["CA", "NV"]], cd.effect_ci["CA"]Methods
| Name | Description |
|---|---|
| fit | Estimate the selected model and return standardized results. |
fit
estimators.scspill.SCSPILL.fit()Estimate the selected model and return standardized results.
Runs the balance check and panel preparation shared by every model, the model’s own estimation (sar: the two-step sampler and the posterior effect sweep; cd: the all-unit SCM equations, the effects, and the P-test inference), and (optionally) the default plot panel.
Returns
| Name | Type | Description |
|---|---|---|
| SCSPILLResults | With the model’s fit in the slot named by method. |
Raises
| Name | Type | Description |
|---|---|---|
| ScspillDataError | On invalid panel data or misaligned spatial weights. | |
| ScspillEstimationError | On an estimation failure (including an unidentified cd exposure structure). |
|
| ScspillPlottingError | On plot generation failure (only when display_graphs). |