"Geiger and Marsden scattering data" theta = (150,135,120,105,75,60,45,37.5,30,22.5,15) theta = theta float(pi) / 180 -- convert to radians x = 1 / (1 - cos(theta))^2 -- Rutherford formula "Silver foil" y = (22.2,27.4,33.0,47.3,136,320,989,1760,5260,20300,105400) beta = dot(x,y) / dot(x,x) beta yhat = beta x yhat ybar = sum(y) / dim(y) RSS = sum((y - yhat)^2) -- residual sum of squares TSS = sum((y - ybar)^2) -- total sum of squares Rsquared = 1 - RSS / TSS Rsquared "Gold foil" y = (33.1,43.0,51.9,69.5,211,477,1435,3300,7800,27300,132000) beta = dot(x,y) / dot(x,x) beta yhat = beta x yhat ybar = sum(y) / dim(y) RSS = sum((y - yhat)^2) -- residual sum of squares TSS = sum((y - ybar)^2) -- total sum of squares Rsquared = 1 - RSS / TSS Rsquared
Run