code: def rate(s=switch, e=early_mean, l=late_mean):
      
      out = np.empty(len(disasters_array))
      # Early mean prior to switchpoint
      out[:s] = e
      # Late mean following switchpoint
      out[s:] = l
      return out
docs: Allocate appropriate mean to time series