Detecting shocks: outliers and breaks in time series