Real-time discrimination of earthquake foreshocks and aftershocks