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: st: "First numlist in weights( ...) invalid" error when using tssmooth to calculate a simple moving average


From   "Brian P. Poi" <[email protected]>
To   [email protected]
Subject   Re: st: "First numlist in weights( ...) invalid" error when using tssmooth to calculate a simple moving average
Date   Thu, 06 Sep 2012 13:25:33 -0500

On 09/06/2012 12:59 PM, Nick Cox wrote:

Sorry; I evidently didn't make myself clear enough, or you've missed
some very minor ironies of style. Where the error arises is not in
doubt.

-set trace- is sufficient to tell exactly where the error occurs and
using it lies behind my previous post. Also, the error occurs when
int(N/2) exceeds 1600, which as you say is when N>= 3202.

I haven't copied my post to Stata tech support, so you may want to
press them gently on the point.

Nick

On Thu, Sep 6, 2012 at 6:42 PM, Aaron Kirkman<[email protected]>  wrote:
I don't know if this code is sufficient to figure out exactly where
the error occurs, but errors occur when _N>= 3202 on my system (Stata
MP 12.1, Unix).

##
set more off
forvalues i = 3100/3300 {
         clear
         capture set obs `i'
         gen x = runiform()
         gen t  = _n
         capture tsset t
         capture tssmooth ma wtma = x, weights(1 2 3 4<5>)
         if _rc == 198 {
                 display as error `i'
         }
}
##

Aaron


Aaron has uncovered a bug in -tssmooth- related to large datasets.  Nick is correct in that the bug gets triggered because numlists in Stata can have at most 1,600 elements.

We will get -tssmooth- fixed in the next ado-file update so that it works with more than 3,201 observations.

   -- Brian Poi
   -- [email protected]
*
*   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