-- Compute R-squared for Bhabha scattering data from DESY PETRA -- Data from www.hepdata.net/record/ins191231 (Table 3, 14.0 GeV) N = 16 -- number of observations -- x is cos(theta) x = ( -0.73, -0.6495, -0.5495, -0.4494, -0.3493, -0.2491, -0.149, -0.0488, 0.0514, 0.1516, 0.252, 0.3524, 0.4529, 0.5537, 0.6548, 0.7323) -- y is differential cross section y = ( 0.10115, 0.12235, 0.11258, 0.09968, 0.14749, 0.14017, 0.1819, 0.22964, 0.25312, 0.30998, 0.40898, 0.62695, 0.91803, 1.51743, 2.56714, 4.30279) y = y "nanobarn" "Observed cross section per bin" y alpha = 0.0072973525693 hbar = 6.582119569 10^(-25) "GeV" "second" c = 299792458 "meter" / "second" s = (14.0 "GeV")^2 C = alpha^2 / (4 s) (hbar c)^2 10^37 "nanobarn" / "meter"^2 yhat = zero(N) for(k,1,N, yhat[k] = C (x[k]^2 + 3)^2 / (x[k] - 1)^2) "Predicted cross section" yhat "Coefficient of determination (R squared)" ybar = sum(y) / dim(y) RSS = sum((y - yhat)^2) -- residual sum of squares TSS = sum((y - ybar)^2) -- total sum of squares 1 - RSS / TSS
Run