Skip to content

Commit 80b83c2

Browse files
committed
ensure that normalized residuals are used
1 parent 29d2da0 commit 80b83c2

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

petab/v1/visualize/plot_residuals.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,11 @@ def plot_goodness_of_fit(
173173
simulation_dfs=simulations_df,
174174
observable_dfs=petab_problem.observable_df,
175175
parameter_dfs=petab_problem.parameter_df,
176+
normalize=True
176177
)[0]
178+
# compute mean of squared normalized residuals
179+
msnr = np.mean(np.power(residual_df["residual"], 2))
180+
177181
slope, intercept, r_value, p_value, std_err = stats.linregress(
178182
simulations_df["simulation"],
179183
petab_problem.measurement_df["measurement"],
@@ -199,8 +203,6 @@ def plot_goodness_of_fit(
199203
ax.plot(x, x, linestyle="--", color="gray")
200204
ax.plot(x, intercept + slope * x, "r", label="fitted line")
201205

202-
# assumes that residuals are normalized by default
203-
msnr = np.mean(np.power(residual_df["residual"], 2))
204206
ax.text(
205207
0.1,
206208
0.70,

0 commit comments

Comments
 (0)