Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


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

RE: Re: st: no room to add more double literals


From   Nick Cox <n.j.cox@durham.ac.uk>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   RE: Re: st: no room to add more double literals
Date   Tue, 18 Jan 2011 18:49:01 +0000

Understood. The example was not meant to be taken literally. 

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


-----Original Message-----
From: owner-statalist@hsphsun2.harvard.edu [mailto:owner-statalist@hsphsun2.harvard.edu] On Behalf Of Sergiy Radyakin
Sent: 18 January 2011 16:31
To: statalist@hsphsun2.harvard.edu
Subject: Re: Re: st: no room to add more double literals

On Tue, Jan 18, 2011 at 11:02 AM, Nick Cox <njcoxstata@gmail.com> wrote:
> In response to
>
>> 1) if I try to input a matrix with 1,1,1,1\2,2,2,2\3,3,3,3.... it hits
>> the limit as well with a different error
>> message, but still pretty soon to be practical.
>
> I may be wrenching this out of context, but I note that there is no
> obvious need to spell out every value of a matrix with such simple
> structure. Consider
>
> : J(1,4,(1..20)')
>         1    2    3    4
>     +---------------------+
>   1 |   1    1    1    1  |
>   2 |   2    2    2    2  |
>   3 |   3    3    3    3  |
>   4 |   4    4    4    4  |
>   5 |   5    5    5    5  |
>   6 |   6    6    6    6  |
>   7 |   7    7    7    7  |
>   8 |   8    8    8    8  |
>   9 |   9    9    9    9  |
>  10 |  10   10   10   10  |
>  11 |  11   11   11   11  |
>  12 |  12   12   12   12  |
>  13 |  13   13   13   13  |
>  14 |  14   14   14   14  |
>  15 |  15   15   15   15  |
>  16 |  16   16   16   16  |
>  17 |  17   17   17   17  |
>  18 |  18   18   18   18  |
>  19 |  19   19   19   19  |
>  20 |  20   20   20   20  |
>     +---------------------+
>
> which can be generalised for "any value of 20" (or 4 for that matter).
> On the other hand, this behaviour of J() was not in the very first
> release of Mata
>
> SJ-8-3  pr0043  . . . . . Stata tip 67: J() now has greater replicating powers
>        . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .  N. J. Cox
>        Q3/08   SJ 8(3):450--451                                 (no commands)
>        tip detailing Mata J() function recent enhancements


That is certainly worth reading, but in my case there is no functional
dependency
between the element's index (in the matrix) and its value. I just have
792 numbers
(and in general case more) to store in a (792 by 1) matrix. You can
think of them
as model coefficients estimates that are predefined and need to be
stored securely
in Mata code.

The above 1,1,1,1\2,2,2,2... line was just an example of the notation

[...] 

*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index