PDA

View Full Version : Pseudo-inverse vs. MULTIREGRESS



hcrisp
03-20-2015, 02:54 PM
I recently benchmarked multi-linear regression on a large dataset using two methods in PV-WAVE -- direct manipulation of the matrix using the pseudo-inverse vs. the MULTIREGRESS function. Surprisingly, the pseudo-inverse was much faster. Is this because the pseudo-inverse leverages OpenMP but MULTIREGRESS does not? I am using 64-bit PV-WAVE 10.0a on Windows 7 and my PC has 4 cores with 8 threads.



FUNCTION matrix_invert, matr
LUFAC, matr, CONDITION=A_c, INVERSE=m_inv
END

; Load result and train matrices
info, result, train
regr = result # TRANSPOSE(train) # MATRIX_INVERT(train # TRANSPOSE(train))

; Transpose the train matrix
info, result, train
regr = MULTIREGRESS(train, result)


Here are the results:



Pseudo-Inverse:
RESULT FLOAT = Array(84210624)
TRAIN FLOAT = Array(7, 84210624)
Elapsed time = 12.277 sec

MULTIREGRESS:
RESULT FLOAT = Array(84210624)
TRAIN FLOAT = Array(84210624, 7)
Elapsed time = 39.063 sec

donb
03-23-2015, 10:06 AM
Yes, that's very likely the case. The OpenMP performance improvements, especially when used with the Automatic Thread Control tuning, are quite impressive!!

There has been no such turning efforts applied to the PV-WAVE Advantage routines.

Don B.