def error_func(guess, x, data, data_model):
  """
  @param guess : parameter list::
    an estimate of the model parameters of the final solution

  @param x : numpy array of float::
    x-values

  @param data : numpy array of y-values

  @param data_model : function to be fitted

  @return: numpy array of float::
    differences between the data and the model
  """
  return data - data_model(x, *guess)