jackscott / python-statlib

Exported from google.code, needed to get this crusty code working in a modern world
https://archive.org/web/
Other
0 stars 0 forks source link

linregress slow down for multiple regression #10

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. calculate trends of 4000 data
2. in each data, calculate the trend from 30 previous data
3. process gradually slow down to unacceptable speed after 1000 data

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
Windows. Python 2.4

Please provide any additional information below.

running code like this scale and you would see the counter slow down gradually:

from statlib import stats

xAxis=list()
yAxis=list()

for i in range(3000):
    for k in range(30):
      xAxis.append(k)
      yAxis.append(k)
    grad, icpt, r, p, se = stats.linregress(xAxis,yAxis)
    print i

Original issue reported on code.google.com by aaronhc...@gmail.com on 18 Jun 2009 at 8:34

GoogleCodeExporter commented 8 years ago
The code above generates an increasingly large dataset, at step 1 the dataset 
size is
30 but by the time you get to step 1000 the dataset size is 30,000, and at the 
final
step the dataset size is 3,000*30=90,000

Clearly the process will start slowing down as you increase the dataset size. 
On my
computer the slowdown is linear as expected.

Original comment by istvan.a...@gmail.com on 18 Jun 2009 at 12:47