Hi all, this is a question about the "matrix division" operators / and 
\. As explained in the guide section 17.5, they can replace the pre- or 
post-multiplication with an inverse (and more). So A * inv(B) will be 
equal to A / B up to numerical error.
Typically this implicit way is recommended over explicit inversion for 
numerical stability and also speed, I think. But what about the special 
case with positive-definite matrices and invpd() ? I was going to use / 
and \ there as well, but the following simple test showed that it's slower.
<hansl>
M = mnormal(50,10)
MM = M'M
pre = mnormal(20,10)
iter = 1000
set stopwatch
loop iter
     m1 = pre * invpd(MM)
endloop
print $stopwatch
loop iter
     m2 = pre / MM
endloop
print $stopwatch
print m1 m2
</hansl>
The second version takes about 2-3 times longer here. (But I know that 
such stuff can heavily depend on the matrix sizes.)
Basically the question is: do we need specialized variants of / and \ 
for pos-def. arguments? Or is there nothing to be gained over the 
explicit inversion with invpd?
thanks
sven
    
    
    
 
                    
                    
                        
                        Show replies by date