parameters: (values, finance_rate, reinvest_rate)
return_statement: return (numer/denom)**(1.0/(n - 1))*(1 + reinvest_rate) - 1
docstring: Modified internal rate of return.
  
      Parameters
      ----------
      values : array_like
          Cash flows (must contain at least one positive and one negative value)
          or nan is returned.  The first value is considered a sunk cost at time zero.
      finance_rate : scalar
          Interest rate paid on the cash flows
      reinvest_rate : scalar
          Interest rate received on the cash flows upon reinvestment
  
      Returns
      -------
      out : float
          Modified internal rate of return
docstring_summary: Modified internal rate of return.
docstring_tokens: Modified internal rate of return .
function: def mirr(values, finance_rate, reinvest_rate):
      """
      Modified internal rate of return.
  
      Parameters
      ----------
      values : array_like
          Cash flows (must contain at least one positive and one negative value)
          or nan is returned.  The first value is considered a sunk cost at time zero.
      finance_rate : scalar
          Interest rate paid on the cash flows
      reinvest_rate : scalar
          Interest rate received on the cash flows upon reinvestment
  
      Returns
      -------
      out : float
          Modified internal rate of return
  
      """
  
      values = np.asarray(values, dtype=np.double)
      n = values.size
      pos = values > 0
      neg = values < 0
      if not (pos.any() and neg.any()):
          return np.nan
      numer = np.abs(npv(reinvest_rate, values*pos))*(1 + reinvest_rate)
      denom = np.abs(npv(finance_rate, values*neg))*(1 + finance_rate)
      return (numer/denom)**(1.0/(n - 1))*(1 + reinvest_rate) - 1
function_tokens: def mirr ( values , finance_rate , reinvest_rate ) : values = np . asarray ( values , dtype = np . double ) n = values . size pos = values > 0 neg = values < 0 if not ( pos . any ( ) and neg . any ( ) ) : return np . nan numer = np . abs ( npv ( reinvest_rate , values * pos ) ) * ( 1 + reinvest_rate ) denom = np . abs ( npv ( finance_rate , values * neg ) ) * ( 1 + finance_rate ) return ( numer / denom ) ** ( 1.0 / ( n - 1 ) ) * ( 1 + reinvest_rate ) - 1