#NEWLINE# def fit_simple_regression( x , y ) : #NEWLINE# #INDENT# slope = ( covariance ( x , y ) / covariance ( x , x ) ) #NEWLINE# offset = ( y . mean ( ) - ( slope * x . mean ( ) ) ) #NEWLINE# return ( x , offset )