The error is contained in pconv
, where the diagonal contains the variance for each one estimated coefficients, which in this case are a
and b
.
From the MathWorld the correlation coefficient r
which measures the overall quality of the fit can be computed as:
sxy = pconv[0,1]*x.shape[0]
sxx = pconv[0,0]
syy = pconv[1,1]
r = (sxy**2/(sxx*syy))**0.5