Re: [Rd] Bug in package stats function ar() (PR#10459)

From: Ben Bolker <bolker_at_ufl.edu>
Date: Sat, 24 Nov 2007 08:45:16 -0800 (PST)

Steven McKinney wrote:
>
> Full_Name: Steven McKinney
> Version: 2.6.0
> OS: OS X
> Submission from: (NULL) (142.103.207.10)
>
>
>
> 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:
>
> x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,-1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3))
> # ar function
> res.ar<-ar(x,aic=TRUE,demean=F)
> # call "ar" again and ............
> res.ar<-ar(x,aic=TRUE,demean=F)
>
>
> Example output:
> (Note that on this attempt the first call to ar()
> tripped the error.)
>

>> x<-ts(c(-0.2052083,-0.3764986,-0.3762448,0.3740089,0.2737568,2.8235722,-

> +
> 1.7783313,0.2728676,-0.3273164),start=c(1978,3),frequency=4,end=c(1980,3))
>>
>

 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.

   Ben Bolker

-- 
View this message in context: http://www.nabble.com/Bug-in-package-stats-function-ar%28%29-%28PR-10459%29-tf4864536.html#a13926484
Sent from the R devel mailing list archive at Nabble.com.

______________________________________________
R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Sat 24 Nov 2007 - 16:48:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 24 Nov 2007 - 22:30:30 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.