Re: [Rd] Fix for bug in arima function

2015-05-28 Thread peter dalgaard
On 28 May 2015, at 10:17 , Martin Maechler wrote: > > On the other hand, to me, it did look a bit strange or "ugly" to always > perform to different lm()s and the coefficients of one and the > residuals of the other. Yes, but the whole point was that if you do OLS on an integrated series, the

Re: [Rd] Fix for bug in arima function

2015-05-28 Thread Martin Maechler
> Patrick Perry > on Wed, 27 May 2015 23:19:09 -0400 writes: {@PP, you forgot this part:} > peter dalgaard > on Thu, 21 May 2015 14:36:03 +0200 writes: >> I suspect that what we really need is >> >> fitI <- lm(x ~ xreg - 1, na.action = na.omit) >> f

Re: [Rd] Fix for bug in arima function

2015-05-27 Thread Patrick Perry
> I suspect that what we really need is > > fitI <- lm(x ~ xreg - 1, na.action = na.omit) > fit <- if(length(dx) > ncol(dxreg)) > lm(dx ~ dxreg - 1, na.action = na.omit) > else list(rank = 0L) > if(fit$rank == 0L) { > ## Degenerate model. Proceed anyway so as not to break old code > fit <- fit

Re: [Rd] Fix for bug in arima function

2015-05-21 Thread Patrick Perry
Thanks for your help, Martin and Peter. I tried taking the value of “n.used” from the C functions (ARIMA_CSS and ARIMA_Like) instead of computing n.used on the R side. Here is a patch, in case you’re interested: https://github.com/patperry/r-source/commit/8fed79a6d2d558ef34738624a2a4f9e795bcf8

Re: [Rd] Fix for bug in arima function

2015-05-21 Thread peter dalgaard
On 21 May 2015, at 12:49 , Martin Maechler wrote: >> peter dalgaard >>on Thu, 21 May 2015 11:03:05 +0200 writes: > >> On 21 May 2015, at 10:35 , Martin Maechler >> wrote: > I noticed that the 3.2.1 release cycle is about to start. Is there any chance that this

Re: [Rd] Fix for bug in arima function

2015-05-21 Thread Martin Maechler
> peter dalgaard > on Thu, 21 May 2015 11:03:05 +0200 writes: > On 21 May 2015, at 10:35 , Martin Maechler wrote: >>> >>> I noticed that the 3.2.1 release cycle is about to start. Is there any >>> chance that this fix will make it into the next version of R? >

Re: [Rd] Fix for bug in arima function

2015-05-21 Thread peter dalgaard
On 21 May 2015, at 10:35 , Martin Maechler wrote: >> >> I noticed that the 3.2.1 release cycle is about to start. Is there any >> chance that this fix will make it into the next version of R? >> >> This bug is fairly serious: getting the wrong variance estimate leads to >> the wrong log-like

Re: [Rd] Fix for bug in arima function

2015-05-21 Thread Martin Maechler
> I noticed that the 3.2.1 release cycle is about to start. Is there any > chance that this fix will make it into the next version of R? > > This bug is fairly serious: getting the wrong variance estimate leads to > the wrong log-likelihood and the wrong AIC, BIC etc, which can and does > lead t

Re: [Rd] Fix for bug in arima function

2015-05-20 Thread Patrick Perry
I noticed that the 3.2.1 release cycle is about to start. Is there any chance that this fix will make it into the next version of R? This bug is fairly serious: getting the wrong variance estimate leads to the wrong log-likelihood and the wrong AIC, BIC etc, which can and does lead to suboptimal

Re: [Rd] Fix for bug in arima function

2015-04-21 Thread peter dalgaard
The bug repository is like an elephant: It doesn't forget, but the gestation period is long. In the present case, it is clear that something is not right, but someone needs to have sufficient recall and insight to check that your proposed fix is not unfixing a deliberate change. We should get t