Multiple linear regression on 3D instead of 2D Y-vectors? [message #46647] |
Tue, 29 November 2005 17:30 |
leatherback
Messages: 15 Registered: November 2005
|
Junior Member |
|
|
Hi All,
As mentioned in my previous post: I am trying to run a code somewhat
more efficient, since it is now taking days to process my data. Finally
I think I have zoomed in a bit on the core of the problem (thx
andrew!).
Basically, I am performing a stepwise regression on field spectral
measurements, within which a repetition loop (n=10,000) runs. (I am
trying to get the mean goodness of fit per waveband over these 10,000
repetitions, basicially performing a bootstrapping routine).
At the moment I am looping through my spectra one band at a time,
perform the regression, go to the next band, untill the last band has
been analyzed, and then start over again, repeating 10,000 times. So
currently for each band:
x = fltarr(48) ; Response array, characteristics of 48 samples
y = fltarr(3,48) ; 3 predictors for 48 samples
TestNStat = regress(y, x, mcorrelation=ThisNCorrelation, /double,
measure_errors=errorvec)
resulting in a single floating point correlation value,
ThisNCorrelation.
This is very time consuming, and I was wondering how to use the
strength of IDL's array calculations for this. If I could do a
regression using a 3D Y-array, I could speed the whole thing up quite a
bit. Basically:
x = fltarr(48) (Or perhaps: x=fltarr(48, 2000) ?)
y = fltarr(3,48, 2000)
Output: A fltarr(2000) of correlation values.
Can someone please tell me how I can achieve this?
Thanks so much for your help!
Yours,
Jelle.
|
|
|