code: def get_R_det2(y_segment, y_avg, y_prime):
      
      numerator = sum((numpy.array(y_segment) - numpy.array(y_prime))**2)
      denominator = sum((numpy.array(y_segment) - y_avg)**2)
      if denominator: # prevent divide by zero error
          R_det2 = 1 - (old_div(numerator, denominator))
          return R_det2
      else:
          return float('nan')
docs: takes in an array of y values, the mean of those values, and the array of y prime values.
      returns R_det2