def ratfit( (xvec, yvec), degree=2 ):
    return Mat([[x**n for n in range(degree,-1,-1)]+[-y*x**n for n in range(degree,0,-1)] for x,y in zip(xvec,yvec)]).solve(Vec(yvec))
Solves design matrix for approximating rational polynomial coefficients (a*x**2 + b*x + c)/(d*x**2 + e*x + 1)
dataset/ETHPy150Open sunlightlabs/clearspending/completeness/statlib/matfunc.py/ratfit