Subcritical and supercritical regimes in epidemic models of earthquake aftershocks