Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Re: Multiple linear regression on 3D instead of 2D Y-vectors?
Here are a kind of generic instructions: As a first step, copy the regress function (regress.pro) from the IDL library to another file, rename it (file and function name to myregress(.pro)) and delete (for a better overview and slightly speed up) all (in this particular case) non used IF THEN ELSE branches. Then look at the code and remove all unnecessary calculations (eg. ftest in line 186) (don't forget to call myregress in your program instead of regress) Look at the speed increase. If it is still not enough paste myregress.pro directly into your code and pull all (within your loop) constant calculations out of the loop. Look then for the possibility of vectorizing calculations. That will speed it up as much as it gets. HTH, marc