<s> from parakeet import jit <EOL> def covariance ( x , y ) : <EOL> return ( ( x - x . mean ( ) ) * ( y - y . mean ( ) ) ) . mean ( ) <EOL> @ jit <EOL> def fit_simple_regression ( x , y ) : <EOL> slope = covariance ( x , y ) / covariance ( x , x ) <EOL> offset = y . mean ( ) - slope * x . mean ( ) <EOL> return slope , offset <EOL> import numpy as np <EOL> N = <NUM_LIT:10> ** <NUM_LIT:4> <EOL> x = np . random . randn ( N ) . astype ( '<STR_LIT>' ) <EOL> slope = <NUM_LIT> <EOL> offset = <NUM_LIT> <EOL> y = slope * x + offset <EOL> slope_estimate , offset_estimate = fit_simple_regression ( x , y ) <EOL> print "<STR_LIT>" , slope , "<STR_LIT>" , offset <EOL> print "<STR_LIT>" , slope_estimate , "<STR_LIT>" , offset_estimate </s>
