diff_diff.PreTrendsPowerCurve
- class diff_diff.PreTrendsPowerCurve[source]
Bases:
objectPower curve across violation magnitudes.
- M_values
Grid of violation magnitudes tested.
- Type:
np.ndarray
- powers
Power at each violation magnitude.
- Type:
np.ndarray
- __init__(M_values, powers, mdv, alpha, target_power, violation_type)
Methods
__init__(M_values, powers, mdv, alpha, ...)plot([ax, show_mdv, show_target, color, ...])Plot the power curve.
Convert to DataFrame with M and power columns.
Attributes
- plot(ax=None, show_mdv=True, show_target=True, color='#2563eb', mdv_color='#dc2626', target_color='#22c55e', **kwargs)[source]
Plot the power curve.
- Parameters:
ax (matplotlib.axes.Axes, optional) – Axes to plot on. If None, creates new figure.
show_mdv (bool, default=True) – Whether to show vertical line at MDV.
show_target (bool, default=True) – Whether to show horizontal line at target power.
color (str) – Color for power curve line.
mdv_color (str) – Color for MDV vertical line.
target_color (str) – Color for target power horizontal line.
**kwargs – Additional arguments passed to plt.plot().
- Returns:
ax – The axes with the plot.
- Return type:
matplotlib.axes.Axes