Given a dataset of lines containing 6 wind forecast values plus 1 observed (actual) value in each like:
FCT1 FCT2 FCT3 FCT4 FCT5 FCT6 OBSERVED
-3.17 3.51 -5.71 1.37 -0.22 -0.65 -2.38
-2.7 2.21 -0.71 2.73 -0.33 -2.62 -1.38
-1.2 3.15 -4.17 3.33 -0.48 -1.65 -2.30
...
-3.0 3.50 -1.79 3.37 -0.18 -0.62 -2.32
To make a rank histogram (or Talagrand Diagram), I understand that I need to loop through the lines, sort the forecast values for each one and assume that the ordered values (six, in this case) are the inner limits of each bin on the diagram. 6 limits generates 7 bins. Then, I need to take the corresponding observed value and increase the bin it fits (the bin that its range contains the observed value). I need to do it for every row, so each row has its limits. It has to do with What PDF should be fit to a rank histogram?. I think it is not a simple histogram built via hist()
in R. Am I wrong?
How about a precipitation forecast data? Like:
FCT1 FCT2 FCT3 FCT4 FCT5 FCT6 OBSERVED
0 0 0.1 0 0 0 0
0 0 0 0 0.02 0 0
0 0.1 0 0 0 0 3
What am I supposed to do to know the bin that has the range that fits the observed value like 0, for example? How can I build 7 bins from this forecast data?
rank_histogram
function in thexskillscore-package
, which provides metrics for verifying forecasts when working withxarrays
in Python. The output can be plotted as a histogram usingmatplotlib.pyplot.barplot()
and adjusting the keywords as you like. $\endgroup$