Date: Thu, 30 Jul 2009 16:40:30 -0400
Reply-To: oloolo <dynamicpanel@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: oloolo <dynamicpanel@YAHOO.COM>
Subject: Re: matrix inverse without IML
I do agree with you.
And I think SAS does need to do some modification to its architecture so
that end users have a more powerful tool set to write their own (complex)
functions. By powerful tool set, I mean a set of well designed basic matrix
operators that work within DATA STEP (not like those only supported by IML).
There are several points to support this argument. SAS can't catch up with
ever increasing faster development in machine learning and statistical
learning area, and with powerful set of matrix operators, end users are
able to contribute to this software, making its up-to-date. It is vital to
keep SAS's competitive edge in BI and its traditional backyard
On Thu, 30 Jul 2009 12:50:11 -0700, Dale McLerran
<stringplayer_2@YAHOO.COM> wrote:
>The FCMP matrix operations which SAS has made available do
>have limited utility. The methods which L Xie (oloolo) has
>proposed do merit serious consideration. However, if one
>really needs to operate on ill-conditioned matrices and if
>there is need for subsequent matrix manipulations, then one
>really should have IML or be using other software better
>suited to such operations (like R).
>
>Dale
>
>---------------------------------------
>Dale McLerran
>Fred Hutchinson Cancer Research Center
>mailto: dmclerra@NO_SPAMfhcrc.org
>Ph: (206) 667-2926
>Fax: (206) 667-5977
>---------------------------------------
>
>
>--- On Thu, 7/30/09, oloolo <dynamicpanel@YAHOO.COM> wrote:
>
>> From: oloolo <dynamicpanel@YAHOO.COM>
>> Subject: Re: matrix inverse without IML
>> To: SAS-L@LISTSERV.UGA.EDU
>> Date: Thursday, July 30, 2009, 11:32 AM
>> the point here is to do the matrix
>> inversion and other basic matrix
>> manipulation (such as to get determinant) on a real-valued
>> arbitrary size
>> matrix with high numerical precision.
>>
>> certainly a user written data step function is good, well,
>> you don't need a
>> Data Step function to do this because you use array anyway
>> in a data step,
>> why not directly write the routine in data step which will
>> be much more
>> efficient? Sample codes are everywhere, say, the famous
>> "Numeric Receipes".
>>
>>
>>
>>
>> On Thu, 30 Jul 2009 14:04:22 -0400, Mike Zdeb <msz03@ALBANY.EDU>
>> wrote:
>>
>> >hi ... wow, a reference to a post from 2001 !!!
>> >
>> >well, since then, if you don't have IML, you can use
>> some matrix functions
>> PROC FCMP
>> >
>> >as was pointed out by a couple postings by Dale
>> McLerran in a few
>> postings, among them ...
>> >
>> >http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0812B&L=sas-l&P=R31866
>> >
>> >http://www.listserv.uga.edu/cgi-bin/wa?A2=ind0905A&L=sas-l&P=R24270
>> >
>> >
>> >data x;
>> >input m1-m3;
>> >datalines;
>> >1 3 3
>> >1 4 3
>> >1 3 4
>> >;
>> >run;
>> >
>> >proc fcmp;
>> >array temp[3,3] / nosymbols;
>> >array im[3,3];
>> >rc = read_array('work.x',temp);
>> >call inv(temp, inverse);
>> >rc = write_array('work.y',im);
>> >quit;
>> >
>> >title 'matrix';
>> >proc print data=x noobs;
>> >run;
>> >
>> >title 'inverse';
>> >proc print data=y noobs;
>> >run;
>> >
>> >matrix
>> >m1 m2 m3
>> > 1 3 3
>> > 1 4 3
>> > 1 3 4
>> >
>> >inverse
>> >im1 im2 im3
>> > 7 -3
>> -3
>> > -1 1 0
>> > -1 0 1
>> >
>> >--
>> >Mike Zdeb
>> >U@Albany School of Public Health
>> >One University Place
>> >Rensselaer, New York 12144-3456
>> >P/518-402-6479 F/630-604-1475
>> >
>> >> by understanding the operations behind a matrix
>> inversion, we certainly
>> can
>> >> resort to SVD algorithm
>> >>
>> >> SVD on a square matrix X is
>> >> X=UEV'
>> >> and once we got matrix U, E, V, we can obtain the
>> inverse of X as
>> >> inv(X)=UE^{-1}V'
>> >>
>> >> since matrix E is an diagonal matrix, its inverse
>> is simply inversion of
>> >> its diagonal scalar elements which can be easily
>> done, taking numerical
>> >> stability into consideration.
>> >>
>> >> Well, I've also point out a way in SAS to do SVD
>> (hence generalized
>> >> inverse) without IML (but you do need SAS/STAT)
>> at
>> >> sas-programming.blogspot.com
>> >>
>> >> now you don't IML or other software and the
>> overhead in exchange data
>> >> between them.
>> >>
>> >> On Thu, 7 Jun 2001 14:21:18 -0700, David L.
>> Cassell
>> >> <Cassell.David@EPAMAIL.EPA.GOV>
>> wrote:
>> >>
>> >>>Howard Schreier wrote [ in part]:
>> >>>>Here's an alternative.
>> >>>>
>> >>>> You probably have Excel.
>> >>>>
>> >>>> Excel has a function (MINVERSE) for
>> inverting matrices.
>> >>>>
>> >>>> You could put the data into Excel, do the
>> calculation, then get the
>> data
>> >>>> back into SAS.
>> >>>
>> >>>Very clever [as usual]. But are you aware
>> that Excel does *not* do a
>> >>>good job on some matrix and stat
>> functions? I believe there is an ACM
>> >>>paper of last year in which two authors tested
>> Excel on NIST test data
>> >>>sets for stats and it did wretchedly. I
>> wouldn't use Excel to invert a
>> >>>matrix
>> >>>without substantial testing first. And if
>> the matrix is ill-conditioned,
>> >>>Excel [or most non-matrix/stat software for
>> that matter] may do a
>> *ghastly*
>> >>>job of inverting the matrix properly.
>> BTW, this is not just another MS
>> >>>slam,
>> >>>because I wouldn't trust any of the popular
>> spreadsheets to do this well
>> >>>without
>> >>>testing first.
>> >>>
>> >>>OTOH, there are realtively inexpensive matrix
>> mainpulation and stats
>> >>>packages
>> >>>which could be used in place of Excel
>> here. GLIM comes to mind, as does
>> >>>Perl's PDL module [which is free - if you can
>> get it to compile on your
>> >>>OS!]
>> >>>and the R system [also free].
>> >>>
>> >>>David
>> >>>--
>> >>>David Cassell, CSC
>> >>>Cassell.David@epa.gov
>> >>>Senior computing specialist
>> >>>mathematical statistician
>> >>
>>
|