[Rd] Bug in package stats function ar() (PR#10459)
maechler at stat.math.ethz.ch
Sat Nov 24 22:41:56 CET 2007
>>>>> "DM" == Duncan Murdoch <murdoch at stats.uwo.ca>
>>>>> on Sat, 24 Nov 2007 16:08:31 -0500 writes:
DM> On 24/11/2007 11:45 AM, Ben Bolker wrote:
>> Steven McKinney wrote:
>>> Full_Name: Steven McKinney Version: 2.6.0 OS: OS X
>>> Submission from: (NULL) (184.108.40.206)
>>> Function ar() in package "stats" is showing a quirky
>>> bug. Some calls to ar() run to completion, others throw
>>> an error.
>>> The bug is reproducible by several people on different
>>> machines, however, the ar() function itself ends up
>>> throwing the error sporadically. Several calls to ar()
>>> may be necessary to trip the error condition.
>>> Code to reproduce:
>>> # ar function res.ar<-ar(x,aic=TRUE,demean=F) # call
>>> "ar" again and ............
>>> Example output: (Note that on this attempt the first
>>> call to ar() tripped the error.)
>> Slightly more detail: in the "eureka" function, in
>> stats/src/eureka.f, the last element of "vars" in the
>> return list is bogus and varies among calls; if it comes
>> out to NaN or NA it triggers the bug.
>> Haven't spent any more time yet tracking this down, but
>> hope that will save someone a few minutes.
DM> Thanks, I'll take a look.
I did too.
It seems pretty obvious that we have to require
order.max < n.used
i.e. order.max <= n.used-1
whereas in the current example, order.max == n.used == 9
I have a small fix which solves the problem and seems to pass
More information about the R-devel