From pdalgd at gmail.com  Tue Apr 21 13:34:43 2015
From: pdalgd at gmail.com (peter dalgaard)
Date: Tue, 21 Apr 2015 13:34:43 +0200
Subject: [Rd] Fix for bug in arima function
In-Reply-To: <25B343E47D08442686D0BB09924080F2@stern.nyu.edu>
References: <25B343E47D08442686D0BB09924080F2@stern.nyu.edu>
Message-ID: <C12E9FD6-C398-407E-92B7-87C18FB922FD@gmail.com>

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 to it eventually. (For some value of "we" not including "me"...)

-pd

On 20 Apr 2015, at 18:34 , Patrick Perry <pperry at stern.nyu.edu> wrote:

> There is currently a bug in the arima function. Namely, for arima models with differencing or seasonal differencing, the innovation variance estimator uses the wrong denominator whenever xreg is non-null. This is the case, for example, when fitting an ARIMA(p,1,q) model with a drift term (common in financial applications). I reported the bug (and a fix) at https://bugs.r-project.org/bugzilla3/show_bug.cgi?id=16278 , but my report may have fallen through the cracks due to the timing around the 3.2.0 release.
> 
> The bug was introduced in the patch displayed here:
> 
> https://github.com/wch/r-source/commit/32f633885a903bc422537dc426644f743cc645e0
> 
> The fix is very simple:
> 
> https://github.com/patperry/r-source/commit/c1701c05ad91d5631eef196c2007ad9897b01f85
> 
> I?ve posted a script that demonstrates the bug at
> 
> https://gist.github.com/patperry/90a388b056e09cf6a51b
> 
> Please let me know if there?s anything I can do to help get this fix incorporated.
> 
> 
> --
> Patrick Perry
> Assistant Professor
> Stern School of Business
> New York University
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel

-- 
Peter Dalgaard, Professor,
Center for Statistics, Copenhagen Business School
Solbjerg Plads 3, 2000 Frederiksberg, Denmark
Phone: (+45)38153501
Office: A 4.23
Email: pd.mes at cbs.dk  Priv: PDalgd at gmail.com



[Rd] Fix for bug in arima function
peter dalgaard