Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: RE: st: mata: how function can return several results


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: RE: st: mata: how function can return several results
Date   Wed, 18 Oct 2006 17:11:02 +0100

Bill tells the story very well, so I only want to add two
small glosses. 

In transmorphic, the "trans" element is indeed of Latin
origin and the "morphic" element is indeed of Greek origin. 
In "television" the "tele" is Greek and the "vision" is 
Latin. 

I was brought up to regard a mixture of Latin and Greek roots
as bad linguistic taste, but that visceral -- or if you prefer 
gut -- instinct may just be prejudice, some version of academic
snobbery whereby language guardians want to lay down rules 
for language creators. 

When Bill explained to me the need for a word for matrices
which, as I understood it, could change their form (or
more precisely content), the word "metamorphic" seemed 
one alternative. Metamorphic rocks were originally laid
down as sediments but then subsequently changed by heat 
and/or pressure. Also, and even better, many people will 
have learned about metamorphosis. 

As the Mata documentation shows, Bill didn't swallow that one, 
and I am not particularly surprised. 

I still cannot work up any affection for "transmorphic". 
Perhaps they should just be called something really simple
like "general" matrices...? 

Nick 
n.j.cox@durham.ac.uk 

William Gould, Stata
 
> Nick Cox <n.j.cox@durham.ac.uk> caught me in a slip of the tongue 
> (well, fingers) when, discussing a Mata program, I wrote -polymorphic-
> rather than -transmoprhic-, e.g., 
> 
>         function whatever(....)
>         {
>                  polymorphic matrix    x
> 
>                  ...
>         }
> 
> rather than, 
> 
>         function whatever(....)
>         {
>                  transmorphic matrix   x
> 
>                  ...
>         }
> 
> Nick wrote, 
> 
> > Bill's forgotten his own term, which is "transmorphic". 
> > The jury's still out on the misbegotten Latin-Greek 
> > hybrid "transmorphic". Oh well, "television" stuck. 
> 
> Here's the history behind that slip and Nick's comment.
> 
> During the development of Mata, what is now called a 
> -transmorphic matrix- 
> was called a -polymorphic matrix-.
> 
> An argument was made that someday we might want matrices in 
> which every
> element could be of a different type.  Right now, Mata 
> requires the types be
> the same:  a matrix is a -real matrix-, or a -complex 
> matrix-, or a -string
> matrix-, etc., meaning each and every element is real, 
> complex, or string.
> 
> The argument for a single matrix containing different types 
> was not made by 
> me and, as a matter of fact, I argued against it.  We need 
> not get into that
> discussion right now.  Nevertheless, I gave in as far as as 
> admitting the
> POSSIBILITY we might want to add matrices containing different types
> someday.
> 
> Those on the winning side were not gracious.  They then argued that
> -polymorphic- was just the right term to describe the matrices they 
> were arguing for.  I needed to find a new word for what I was calling
> -polymorphic-, they said.
> 
> At this point, the loss of the word was more irritating to me than 
> the loss of the argument, and I briefly reconsidered reopening the 
> argument just get the word back.  Being a mature person, however,
> and unlike those arguing against me, I did not.
> 
> One of the ring-leaders of the opposite side of the debate suggested
> -transmorphic-.  I found that word acceptable, but I decided 
> to ask Nick 
> what he thought.  "Oh, no, no, no," Nick said.  "Oh, dear."
> 
> "What's the problem?" I asked.
> 
> Nick went on to explain to me that trans- is a LATIN prefix 
> and -morphic
> is a GREEK suffix -- do I have that right, Nick, or is it the 
> other way
> around? -- and evidently he found something disturbing about that.
> He mumbled something about television.  
> 
> "There's something on television?"
> 
> "No, no, no.  The WORD television."
> 
> "Oh, you mean like hexadecimal!"
> 
> "Yes, exactly!"
> 
> "I like hexadecimal numbers."
> 
> I thanked Nick for clarifying the situation for me, although 
> he went on 
> endlessly in favor of -metaphorphic-.  Well, Nick is a 
> geographer.  Meta-
> sounds so damn slow.
> 
> The irony is that I ultimately won the argument against matrices with
> different types.  The argument for such matrices was based on 
> the statement
> about how convenient it would be to be able to create a 
> vector the first
> element of which could be a string (such as a title), the 
> second element a
> real scalar (such as the number of observations), the third 
> element a matrix
> (such as a VCE), and so on.  Much better than referring to results[1],
> results[2], and results[3], however, is results.title, 
> results.obs, and
> results.vce.  Structures were what they wanted, not matrices 
> with elements of
> different types.  And notice that I still get my way about 
> every element of a
> matrix having the same type.  I could have a vector of results[], with
> results[1].title and results[2].title, results[1].obs and 
> results[2].obs, and
> results[1].vce and results[2].vce.
> 
> I had a reason for wanting matrices of elements of the same 
> type.  Matrices
> with elements of different types would slow Mata down, bring 
> Mata to its
> knees, if you will excuse the mixed metaphore, which you 
> should as long as you
> are excusing the mix of languages.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index