code: def R(v):
      rq = dot(v.T, A * v) / dot(v.T, B * v)
      res = (A * v - rq * B * v) / linalg.norm(B * v)
      data.append(linalg.norm(res))
      return rq
  
file_path: statsmodels/statsmodels/sandbox/mle.py
imports: import numpy
  from numpy import dot, outer, random
  from scipy import io, linalg, optimize
  from scipy.sparse import eye
  import matplotlib.pyplot
label_desc: Use image node_id 1 for calling a global function with example usage: R(v) and returns: rq