Extrapolating time series by discounted least squares