pod.compute_pod_curve
compute_pod_curve(
X_eval,
mean_model,
X,
residuals,
bandwidth,
dist_info,
threshold,
)Calculates the Probability of Detection (PoD) curve.
Combines the Mean Model, Variance Model, and Error Distribution to compute the probability that the signal exceeds the threshold at every point in X_eval.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X_eval | np.ndarray | The grid points to calculate PoD for. | required |
| mean_model | Any | The fitted sklearn mean response model. | required |
| X | np.ndarray | Original input data (needed for variance prediction). | required |
| residuals | np.ndarray | Original residuals (needed for variance prediction). | required |
| bandwidth | float | Smoothing bandwidth. | required |
| dist_info | Tuple[str, Tuple] | The (name, params) of the error distribution. | required |
| threshold | float | The detection threshold value. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Tuple[np.ndarray, np.ndarray] | Tuple[np.ndarray, np.ndarray]: - pod_curve: Array of probabilities [0, 1] for each point in X_eval. - mean_curve: Array of mean signal response values for X_eval. |
Examples
# Assuming we have fitted models (mean_model) and data (X, residuals)
# Calculate the PoD curve for a threshold of 0.5
pod, mean_resp = compute_pod_curve(
X_eval=np.linspace(0, 10, 100),
mean_model=mean_model,
X=X,
residuals=residuals,
bandwidth=1.5,
dist_info=('norm', (0, 1)),
threshold=0.5
)