Skip to content

Commit 21d275c

Browse files
Biondinipabloitu
andauthored
Updating the Concentration ROC diagram and adding the ROC and Molchgan plots using the alarm-based approach (#254)
* introduction of Contingency Molchan and ROC diagrams I added the code to plot the contingency_ROC and the contingency_Molchan in the .\csep\utils\plots.py. I also inserted the two funcions in the tutorial of "gridded_forecast_evaluation.py" * Tutorial to draw the contingency_ROC and Molchan diagrams i inserted the two function in the example "gridded_forecast_evaluation.py" * Upgrade ROC diagram and new plots Molchan and ROC diagrams. * fixed plot_gridded_forecast.py updated function name call * updated function names in gridded_forecast_evaluation.py * removed plot_roc_diagram from plot_gridded_forecast.py --------- Co-authored-by: Pablo Iturrieta <69042881+pabloitu@users.noreply.github.com>
1 parent 20be367 commit 21d275c

File tree

9 files changed

+1451
-7
lines changed

9 files changed

+1451
-7
lines changed

csep/utils/plots.py

Lines changed: 406 additions & 4 deletions
Large diffs are not rendered by default.
14.5 KB
Binary file not shown.
45.5 KB
Loading

examples/tutorials/example_spatial_test.json

Lines changed: 1013 additions & 0 deletions
Large diffs are not rendered by default.

examples/tutorials/gridded_forecast_evaluation.py

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,38 @@
118118
# When comparing the forecast ROC curve against a catalog, one can evaluate if the forecast is more or less specific (or smooth) at different level or seismic rate.
119119
#
120120
# Note: This figure just shows an example of plotting an ROC curve with a catalog forecast.
121+
# If "linear=True" the diagram is represented using a linear x-axis.
122+
# If "linear=False" the diagram is represented using a logarithmic x-axis.
123+
124+
125+
print("Plotting concentration ROC curve")
126+
_= plots.plot_concentration_ROC_diagram(forecast, catalog, linear=True)
127+
128+
129+
130+
131+
####################################################################################################################################
132+
# Plot ROC and Molchan curves using the alarm-based approach
133+
# -----------------------
134+
#In this script, we generate ROC diagrams and Molchan diagrams using the alarm-based approach to evaluate the predictive
135+
#performance of models. This method exploits contingency table analysis to evaluate the predictive capabilities of
136+
#forecasting models. By analysing the contingency table data, we determine the ROC curve and Molchan trajectory and
137+
#estimate the Area Skill Score to assess the accuracy and reliability of the prediction models. The generated graphs
138+
#visually represent the prediction performance.
139+
140+
# Note: If "linear=True" the diagram is represented using a linear x-axis.
141+
# If "linear=False" the diagram is represented using a logarithmic x-axis.
142+
143+
print("Plotting ROC curve from the contingency table")
144+
# Set linear True to obtain a linear x-axis, False to obtain a logical x-axis.
145+
_ = plots.plot_ROC_diagram(forecast, catalog, linear=True)
146+
147+
print("Plotting Molchan curve from the contingency table and the Area Skill Score")
148+
# Set linear True to obtain a linear x-axis, False to obtain a logical x-axis.
149+
_ = plots.plot_Molchan_diagram(forecast, catalog, linear=True)
150+
151+
121152

122-
print("Plotting ROC curve")
123-
_ = plots.plot_ROC(forecast, catalog)
124153

125154
####################################################################################################################################
126155
# Calculate Kagan's I_1 score
@@ -130,4 +159,4 @@
130159
# (see Kagan, YanY. [2009] Testing long-term earthquake forecasts: likelihood methods and error diagrams, Geophys. J. Int., v.177, pages 532-542).
131160

132161
I_1 = get_Kagan_I1_score(forecast, catalog)
133-
print("I_1score is: ", I_1)
162+
print("I_1score is: ", I_1)

examples/tutorials/molchan_figure.pdf

15.6 KB
Binary file not shown.

examples/tutorials/molchan_figure.png

49.6 KB
Loading

examples/tutorials/roc_figure.pdf

15.6 KB
Binary file not shown.

examples/tutorials/roc_figure.png

63.4 KB
Loading

0 commit comments

Comments
 (0)