-- Compute R-squared for annihilation data from DESY PETRA -- www.hepdata.net/record/ins191231 (Table 2, 14.0 GeV) -- x is cos(theta) x = ( 0.0502, 0.1505, 0.2509, 0.3512, 0.4516, 0.5521, 0.6526, 0.7312) -- y is differential cross section y = ( 0.09983, 0.10791, 0.12026, 0.13002, 0.17681, 0.1957, 0.279, 0.33204) "nanobarn" "Observed cross section per bin" y alpha = 7.2973525693 10^(-3) c = 299792458.0 meter / second h = 6.62607015 10^(-34) joule second hbar = h / float(2 pi) eV = 1.602176634 10^(-19) joule s = (14.0 10^9 eV)^2 C1 = alpha^2 / (2 s) C2 = (hbar c)^2 C3 = 10^37 "nanobarn" / meter^2 C = C1 C2 C3 yhat = C ((1 + x) / (1 - x) + (1 - x) / (1 + x)) "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