plot_signal_model

plot_signal_model(
    X,
    y,
    X_eval,
    mean_curve,
    threshold,
    local_std=None,
    poi_name='Parameter of Interest',
    ax=None,
)

Diagnostic Plot 1: Signal vs Parameter of Interest (The Physics).

Visualizes the raw simulation data, the fitted mean model, and the detection threshold. Equivalent to Figure 6/12 in the Generalized Method paper.

Parameters

Name Type Description Default
X np.ndarray The raw parameter of interest values. required
y np.ndarray The raw signal responses. required
X_eval np.ndarray The grid of points used for the curves. required
mean_curve np.ndarray The predicted mean response at X_eval. required
threshold float The detection threshold (horizontal line). required
local_std np.ndarray The predicted standard deviation at X_eval. If given, adds ±2σ (about 95%) prediction bounds. Defaults to None. None
poi_name str x-axis label. Defaults to “Parameter of Interest”. 'Parameter of Interest'
ax plt.Axes Axes to draw on. Defaults to None (a new figure is created). None

Returns

Name Type Description
plt.Axes plt.Axes: The axes drawn on (the given ax, or a new one on a new figure).

Examples

import matplotlib.pyplot as plt

# Plot the physics model
ax = plot_signal_model(
    X, y, X_eval, mean_curve,
    threshold=3.0,
    local_std=std_curve,
    poi_name="Crack Length (mm)"
)
plt.show()