

Here's some code to demonstrate the issue: > import numpy > from scipy.stats import linregress > from regressor import linregress as linreg2 > a = numpy.

The divergence only occurs with some inputĪrrays of random numbers, about 55% of runs in my tests, depending on the is also affectedīy this, but to a lesser degree. However, the p-value can divergeĭue to imprecision from float addition. Should be shifted up by the incremented value. array + 1.2e-7), we expect the same slope and p-value, but the intercept When regressing again with itself incremented slightly when you regress a small array with itself, the p-value

I could only find one scenario where the behavior of this package differs from Reliability across a wide range of P-values.

Sampled values with varying correlation between the X and Y arrays to assess The graphs below demonstrate this consistency by comparing betas, r-values and The regression results from this package match to withinĤ decimal places (for the slope, intercept, r-value, p-value and standard error). In general, this package performs simple linear regression in about 1/20th of This package and, starting from arrays with 10 elements The graph below compares the times required for simple linear regressions between float32 ) > linregress ( x, y ) LinregressResult ( slope =- 1.0, intercept = 6.0, rvalue =- 1.0, pvalue = 1.2e-30, stderr = 0.0 ) Performance Usage > import numpy as np > from regressor import linregress > x = np. On x86-64 hardware with AVX extensions (most desktops and servers as of 2020). The input numpy arrays need to be 1D with 32-bit floats.Īs a result, this is ~20X faster than, but only runs This uses vectorized operations to speed up calculating dot This is a small library that tries to run simple linear regression quickly on
