code: def f_D_star_error(params, gtab, signal, S0, D):
      """Error function used to fit f and D_star keeping S0 and D fixed
  
      Parameters
      ----------
      params : array
          The value of f and D_star.
  
      gtab : GradientTable class instance
          Gradient directions and bvalues.
  
      signal : array
          Array containing the actual signal values.
  
      S0 : float
          The parameters S0 obtained from a linear fit.
  
      D : float
          The parameters D obtained from a linear fit.
  
      Returns
      -------
      residual : array
          An array containing the difference of actual and estimated signal.
  
      """
      f, D_star = params
      return signal - f_D_star_prediction([f, D_star], gtab, S0, D)
  
imports: import warnings
  import numpy
  from scipy.optimize import least_squares, differential_evolution
  from dipy.reconst.base import ReconstModel
  from dipy.reconst.multi_voxel import multi_voxel_fit
  from dipy.utils.optpkg import optional_package
label_desc: Use image node_id 4 for calling a global function with example usage: f_D_star_error(params, gtab, signal, S0, D) and returns: unknown