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: RE: Saving large result set from Mata to file


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Saving large result set from Mata to file
Date   Tue, 6 Mar 2012 12:09:36 +0000

I would rule out 1) and 2). 

1) is quite unnecessary and would lose precision. There are other disadvantages, but I stop there. 

2) Stata matrices are very limited in size and putting results into Stata matrices would only be a first step. 

3) does look like your best option. But check out -getmata- as well. 

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

Lacy,Michael

I have a Mata program that generates a large number of instances of (i.e. > 1e6) of an integer-valued row vector of modest length, say < 30 
rows.  Using each such vector, a real scalar value is calculated in Mata.   I'd like to save these results as a Stata file as one would with -post- 
or the saving option of -simulate-.   The ways I'm thinking of doing this seem rather clumsy and slow, so I'm wondering if I'm not finding
 some easier approach. I've thought of 1) Writing the results as ASCII from Mata, and -insheeting- the file in Stata, in chunks if
necessary;   2) Passing the results back into Stata matrices, and using -post- on those matrices in Stata; 3) Keep the entire set of results
 in Mata matrices, and using -st_store- to put them back into Stata. The results may end up being too large to fit in Stata at one time, which 
makes 3) not entirely attractive.   

Would anyone offer other suggestions, or perhaps simply  a confirmation that these are my only options?

Regards, 

Mike Lacy
Dept. of Sociology
Colorado State University
Fort Collins CO 80523-1784




*
*   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/

*
*   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