From 76cc918e00bbf2578dc991a79c839a1fb0b7e3bb Mon Sep 17 00:00:00 2001 From: Rikard Nordgren Date: Thu, 22 Aug 2024 12:57:44 +0200 Subject: [PATCH] sse: Fix bad calculation of relative absolute bias in --- .../release_notes/release_notes_PsN_next_version.txt | 6 ++++++ doc/sse_userguide.tex | 2 +- lib/tool/sse.pm | 3 +-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/development/release_notes/release_notes_PsN_next_version.txt b/development/release_notes/release_notes_PsN_next_version.txt index 7089ab946..6db300000 100644 --- a/development/release_notes/release_notes_PsN_next_version.txt +++ b/development/release_notes/release_notes_PsN_next_version.txt @@ -14,3 +14,9 @@ Changes and bug fixes from PsN 5.4.0 to x.x.x * Handle missing_data_token properly when it is not -99 ___scm___ + + + ___sse___ + +* Calculation of relative absolute bias was wrong. Now it does abs((est-true)/true) + before it did (est-true)/abs(true) diff --git a/doc/sse_userguide.tex b/doc/sse_userguide.tex index 929849f8b..80000bff5 100644 --- a/doc/sse_userguide.tex +++ b/doc/sse_userguide.tex @@ -189,7 +189,7 @@ \subsection{Explanation for data items in sse\_results.csv:} relative\verb|_|bias = 100\% \frac{1}{N} \sum_i \frac{est_i - true_i}{true_i} \] \[ -relative\verb|_|absolute\verb|_|bias = 100\% \frac{1}{N} \sum_i \frac{est_i - true_i}{|true_i|} +relative\verb|_|absolute\verb|_|bias = 100\% \frac{1}{N} \sum_i \left|\frac{est_i - true_i}{true_i}\right| \] \[ Rse_{bias} = relativestandarderror = 100\% \frac{sd}{True \sqrt{N}} diff --git a/lib/tool/sse.pm b/lib/tool/sse.pm index 45d114223..6dc06448c 100644 --- a/lib/tool/sse.pm +++ b/lib/tool/sse.pm @@ -2316,8 +2316,7 @@ sub compute_bias $sum_relative_errors += ($self->raw_results->[$i][$column_index] - $initial_values[$i-$start_row_index])/($initial_values[$i-$start_row_index]); $sum_relative_absolute_errors += - ($self->raw_results->[$i][$column_index] - $initial_values[$i-$start_row_index])/abs($initial_values[$i-$start_row_index]); - #possibly change to abs in numerator for relative_absolute + abs(($self->raw_results->[$i][$column_index] - $initial_values[$i-$start_row_index]) / $initial_values[$i-$start_row_index]); } } }