From pperry at stern.nyu.edu  Mon Apr 20 18:34:26 2015
From: pperry at stern.nyu.edu (Patrick Perry)
Date: Mon, 20 Apr 2015 12:34:26 -0400
Subject: [Rd] Fix for bug in arima function
Message-ID: <25B343E47D08442686D0BB09924080F2@stern.nyu.edu>

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



[Rd] Fix for bug in arima function
Patrick Perry