Skip to content

Early-warning signals and ROC analysis

In the app: Help → Help contents, Early-warning signals and ROC analysis.

An early-warning indicator is judged by how well it signals events before they happen: banking or currency crises, recessions, debt distress, defaults. Forecast → Evaluate early-warning signals… (early_warning(data, indicators, events) in code) ranks many candidates at once; the pieces are functions of their own.

The target. Events is a 0/1 series, 1 in every period of a crisis. A signal is right if an event starts within the horizon: event_windows(events, horizon=8) marks the 8 periods before each event's first period as pre-event (Bussière and Fratzscher 2006), or a range such as (5, 12) leaves out the periods too close to call. The crisis periods are left out, and so are the post-event periods after each (post=4): indicators then behave as neither calm nor pre-crisis, the post-crisis bias. A period after one crisis and before the next is pre-event. Periods whose window runs past the end of the data, with no event seen, are left out: they may yet precede one. In a panel the windows are per country.

The 2 x 2 table. With A signals followed by an event, B false alarms, C missed events and D quiet calm periods (Kaminsky, Lizondo and Reinhart 1998), classification_table(scores, target, threshold) gives the hit rate A / (A + C) (sensitivity, power), the false-alarm rate B / (B + D) = 1 - specificity, the precision A / (A + B), the negative predictive value, accuracy, balanced accuracy, F1, the Kuipers score or Youden's J (hit rate less false-alarm rate), the odds ratio AD / BC and KLR's noise-to-signal ratio, the false-alarm rate over the hit rate (below 1, the signals beat noise), with Wilson intervals for the proportions.

The threshold. choose_threshold(scores, target) shows the whole trade-off and picks the threshold that minimises the policymaker's loss L(mu) = mu T1 P1 + (1 - mu) T2 P2 (Sarlin 2013), with T1 the share of events missed, T2 the false-alarm rate, P1 the share of pre-event periods and mu the weight on a missed event (a cost ratio c of a miss to a false alarm is mu = c / (1 + c)). Ignoring the indicator costs min(mu P1, (1 - mu) P2), so the absolute usefulness is that less L, and the relative usefulness is it as a share of that: 1 is a perfect indicator, 0 or less one not worth using. Alessi and Detken's (2011) version leaves out P1 and P2. With rare events, signals are useful only when mu is high: a policymaker who weighs a miss and a false alarm alike is better off never acting. The Youden index and the noise-to-signal ratio are the other criteria; the second needs a guard against thresholds so high that one lucky signal makes the ratio zero, so by default a tenth of the periods must signal (KLR searched thresholds signalling in 10 to 20 per cent).

The ROC curve plots the hit rate against the false-alarm rate as the threshold moves; the area under it (AUROC) is the chance that a pre-event period scores higher than a calm one: 0.5 is no skill, 1 perfect, whatever the threshold or the policymaker's preferences (Drehmann and Juselius 2014). roc_analysis(scores, target) gives it with DeLong, DeLong and Clarke-Pearson's (1988) standard error and interval (Sun and Xu's 2014 algorithm), or a bootstrap: events and calm periods resampled separately, whole countries (a panel's periods are not independent), or blocks of consecutive periods, which give wider and more honest intervals for serially correlated signals. partial=0.2 adds the area at false-alarm rates up to 0.2, standardised as McClish (1989) does so that 0.5 is again no skill. roc_test(scores1, scores2, target) is DeLong's test that two indicators have the same AUROC on the same periods (correlated curves); with outcomes2, on different samples. Direction: an indicator such as reserves signals when low; "auto" takes the direction that discriminates, which flatters a useless indicator a little, since in sample it never scores below 0.5.

Lead times. Each event is called if the indicator signalled at least once in its pre-event window; the lead time is the number of periods from the first such signal to the event, and the ranking gives the share of events called and the average lead. A model's fitted probability, a logit of the pre-event target on several indicators, is evaluated as one more indicator; its in-sample AUROC flatters it, as any in-sample fit does.

See also

References

  • Kaminsky, G., Lizondo, S. and Reinhart, C. M. (1998). Leading indicators of currency crises. IMF Staff Papers 45(1), 1-48. (search)
  • Bussière, M. and Fratzscher, M. (2006). Towards a new early warning system of financial crises. Journal of International Money and Finance 25(6), 953-973. (search)
  • Alessi, L. and Detken, C. (2011). Quasi real time early warning indicators for costly asset price boom/bust cycles: a role for global liquidity. European Journal of Political Economy 27(3), 520-533. (search)
  • Sarlin, P. (2013). On policymakers' loss functions and the evaluation of early warning systems. Economics Letters 119(1), 1-7. (search)
  • Drehmann, M. and Juselius, M. (2014). Evaluating early warning indicators of banking crises: satisfying policy requirements. International Journal of Forecasting 30(3), 759-780. (search)
  • DeLong, E. R., DeLong, D. M. and Clarke-Pearson, D. L. (1988). Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach. Biometrics 44(3), 837-845. (search)
  • Sun, X. and Xu, W. (2014). Fast implementation of DeLong's algorithm for comparing the areas under correlated receiver operating characteristic curves. IEEE Signal Processing Letters 21(11), 1389-1393. (search)
  • McClish, D. K. (1989). Analyzing a portion of the ROC curve. Medical Decision Making 9(3), 190-195. (search)
  • Wilson, E. B. (1927). Probable inference, the law of succession, and statistical inference. Journal of the American Statistical Association 22(158), 209-212. (search)