function [slope, inter] = linear(x, y)
% alpha + beta*x
xm = mean(x);
ym = mean(y);
Sx = sum(x);
Sx2 = sum(x.*x);
Sy = sum(y);
Sy2 = sum(y.*y);
SP = sum(x.*y);
n = numel(x);


slope = (SP-Sx*Sy/n)/(Sx2-(Sx)^2/n);
inter = ym - slope*xm;

