Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: Using -J()- in Mata when initializing vectors


From   "Joseph Coveney" <jcoveney@bigplanet.com>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: Using -J()- in Mata when initializing vectors
Date   Thu, 14 Apr 2011 12:57:11 +0900

Does anyone have advice about whether -J(1, <vector length>, <element>)- or 
-J(<vector length>, 1, <element>)- is better when initializing a -vector- 
organizational type in Mata?  

The online documentation for declarations (-help m2_declarations-) says, "If n 
had been declared a vector, a 0 x 1 vector would have been created.  Mata could
just as well have created a 1 x 0 vector, but it creates a 0 x 1."  This is the
same result as when n is declared to be -colvector- (see just above in the help
file).  Can I rightly construe this to imply that Mata would favor 
-J(<vector length>, 1, <element>)-?

Assuming that the -vector- organizational type is not intended for use in
inner or outer products, etc., is there any other reason to favor one -J()- 
over the other with -vector-?

Joseph Coveney


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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   |   Site index