Commit 26966b07 authored by Thibault Hallouin's avatar Thibault Hallouin
Browse files

fix the order of the X and Y axes in REL_DIAG

1 merge request!3release v0.1.0
Pipeline #43615 passed with stage
in 2 minutes and 39 seconds
Showing with 9 additions and 6 deletions
+9 -6
......@@ -184,7 +184,8 @@ namespace evalhyd
namespace metrics
{
/// Compute the reliability diagram X and Y axes.
/// Compute the reliability diagram X and Y axes, the forecast
/// probability and the observed relative frequency, respectively.
///
/// \param o_j
/// Tallies of streamflow observations for all possible ranks.
......@@ -238,19 +239,21 @@ namespace evalhyd
// calculate length of subset
auto l = xt::sum(t_msk_sampled, -1);
// compute the forecast probability $y_i$
// [X-axis]
xt::view(REL_DIAG, xt::all(), xt::all(), m, e, xt::all(), 0) =
xt::arange<double>(double(n_mbr + 1)) / n_mbr;
// compute the observed relative frequency
// [Y-axis]
// $\bar{o_j} = \frac{1}{n} \sum_{k \in M_j} r_k$
xt::view(REL_DIAG, xt::all(), xt::all(), m, e, xt::all(), 0) =
xt::view(REL_DIAG, xt::all(), xt::all(), m, e, xt::all(), 1) =
xt::cumsum(
xt::view(o_j, xt::all(), xt::all(),
m, e, xt::all())
/ l,
-1
);
// compute the forecast probability $y_i$
xt::view(REL_DIAG, xt::all(), xt::all(), m, e, xt::all(), 1) =
xt::arange<double>(double(n_mbr + 1)) / n_mbr;
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment