utils/stats.py
def linreg(x, y):
	'''Computes a linear regression through the origin using OLS'''
	x = np.array(x)
	y = np.array(y)
	x = x[:, np.newaxis]
	a, _, _, _ = np.linalg.lstsq(x, y, rcond=-1.)
	r2 = q(y, (x * a)[:, 0])
	return (r2, a)
Computes a linear regression through the origin using OLS
Computes a linear regression through the origin using OLS
Computes a linear regression through the origin using OLS
def linreg(x, y):
	x = np.array(x)
	y = np.array(y)
	x = x[:, np.newaxis]
	a, _, _, _ = np.linalg.lstsq(x, y, rcond=-1.)
	r2 = q(y, (x * a)[:, 0])
	return (r2, a)
def linreg ( x , y ) : x = np . array ( x ) y = np . array ( y ) x = x [ : , np . newaxis ] a , _ , _ , _ = np . linalg . lstsq ( x , y , rcond = - 1. ) r2 = q ( y , ( x * a ) [ : , 0 ] ) return ( r2 , a )
Computes a linear regression through the origin using OLS
Computes a linear regression through the origin using OLS
'''Computes a linear regression through the origin using OLS'''
x
y