ahat.compute_linear_pod_curve
compute_linear_pod_curve(X_eval, model, tau, threshold, xlog=False, ylog=False)Calculates the PoD curve using the standard a-hat vs a analytical assumptions.
Assumes that the residual errors are perfectly normally distributed with a constant standard deviation (tau).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| X_eval | np.ndarray | The 1D grid of points to evaluate the PoD curve. | required |
| model | LinearRegression | The fitted linear expectation model. | required |
| tau | float | The constant standard deviation of the residuals. | required |
| threshold | float | The detection threshold in original (untransformed) units. | required |
| xlog | bool | Indicates if the model was trained with log-transformed X. | False |
| ylog | bool | Indicates if the model was trained with log-transformed y. | False |
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 expected mean signal responses in original units. |
Examples
# Assuming we have the model and tau from the fitting step
X_eval = np.linspace(1, 10, 100)
pod, mean_response = compute_linear_pod_curve(
X_eval, model, tau, threshold=3.5, xlog=True, ylog=False
)