Skip to content

Commit 39a487f

Browse files
committed
fix mean of residuals in plot_goodness_of_fit
1 parent 44c8062 commit 39a487f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

petab/v1/visualize/plot_residuals.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -199,15 +199,16 @@ def plot_goodness_of_fit(
199199
ax.plot(x, x, linestyle="--", color="gray")
200200
ax.plot(x, intercept + slope * x, "r", label="fitted line")
201201

202-
mse = np.mean(np.abs(residual_df["residual"]))
202+
# assumes that residuals are normalized by default
203+
msnr = np.mean(np.power(residual_df["residual"], 2))
203204
ax.text(
204205
0.1,
205206
0.70,
206207
f"$R^2$: {r_value**2:.2f}\n"
207208
f"slope: {slope:.2f}\n"
208209
f"intercept: {intercept:.2f}\n"
209210
f"p-value: {p_value:.2e}\n"
210-
f"mean squared error: {mse:.2e}\n",
211+
f"mean of squared normalized residuals: {msnr:.2e}\n",
211212
transform=ax.transAxes,
212213
)
213214

0 commit comments

Comments
 (0)