Skip to content
Submodule
causalis.scenarios.unconfoundedness.refutation.score.residual_plots

residual_plots

Submodule causalis.scenarios.unconfoundedness.refutation.score.residual_plots with no child pages and 2 documented members.

Functions

Jump directly into the documented functions for this page.

1 items

Data

Jump directly into the documented data for this page.

1 items
function
causalis.scenarios.unconfoundedness.refutation.score.residual_plots.plot_residual_diagnostics

plot_residual_diagnostics

Plot residual diagnostics for nuisance models.

Panels

  1. Treated-only: u1 = y - g1 vs g1.

  2. Control-only: u0 = y - g0 vs g0.

  3. Binned calibration error: E[d - m | m in bin] vs binned m.

Notes

These plots check the nuisance pieces directly:

  • outcome residuals u1=Yg^1(X)u_1 = Y - \hat g_1(X) and u0=Yg^0(X)u_0 = Y - \hat g_0(X) should look roughly centered around zero without strong patterns against fitted values,

  • treatment residuals Dm^(X)D - \hat m(X) should average near zero within propensity bins.

Clear trends usually mean the nuisance models still leave structure in the data, which can show up later as unstable score diagnostics.

Parameters

estimateCausalEstimate

Estimate with diagnostic data (m_hat, g0_hat; optionally g1_hat, y, d).

dataCausalData, optional

Optional fallback source for y and d when missing in diagnostic data.

clip_propensityfloat, default 1e-6

Clipping epsilon for propensity values in the treatment-residual panel.

n_binsint, default 20

Number of quantile bins for the binned-mean trend overlays.

marker_sizefloat, default 12.0

Scatter marker size.

alphafloat, default 0.35

Scatter opacity.

max_scatter_pointsint, optional

Maximum number of points drawn in each residual scatter panel. When set, scatter points are sampled uniformly without replacement, while the binned-mean overlays and calibration panel still use all observations.

random_stateint, optional

Random seed used when max_scatter_points triggers scatter sampling.

figsizetuple, default (14.0, 4.8)

Figure size.

dpiint, default 220

Dots per inch.

font_scalefloat, default 1.10

Font scaling factor.

savestr, optional

Path to save the figure.

save_dpiint, optional

DPI for saving.

transparentbool, default False

Whether to save with transparency.

Returns

matplotlib.figure.Figure

The generated figure.

Examples

Canonical target

causalis.scenarios.unconfoundedness.refutation.score.residual_plots.plot_residual_diagnostics

Sections

PanelsNotesParametersReturnsExamples
Link to this symbol
data
causalis.scenarios.unconfoundedness.refutation.score.residual_plots.__all__

__all__

Value: ['plot_residual_diagnostics']

[‘plot_residual_diagnostics’]

Canonical target

causalis.scenarios.unconfoundedness.refutation.score.residual_plots.__all__

Link to this symbol