Statistical physics approach to earthquake occurrence and forecasting