[S] Inverse function for x[col(x)<row(x)]

Wed, 21 Oct 98 17:31 EDT

Randi Chen asks if S-Plus has a function which does the inverse
of "x[col(x)<row(x)]". This operation is very similar to
compressed storage of a symmetric matix. I am not aware of
an explicit inverse function in S-Plus to do this. But when I
have to resurrect a covariance matrix from its compressed mode,
I do the following:

CovMat _ matrix (0, ddim, ddim )
CovMat[ row(CovMat) >= col(CovMat) ] _ my.compressed.data
CovMat _ CovMat + t(CovMat)
diag(CovMat) _ diag(CovMat)/2

It is easy to adapt this to the problem posed. (In fact it looks like
you don't need the last two lines, and other minor modifications.)

Andrey Feuerverger, Dept Statistics, Univ Toronto, andrey@utstat.toronto.edu

p.s. If anyone has a nicer way, please let me know..

This message was distributed by s-news@wubios.wustl.edu. To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message: unsubscribe s-news