Skip to content

Commit

Permalink
Merge 47eba0e into 3396b98
Browse files Browse the repository at this point in the history
  • Loading branch information
jseabold committed Jan 6, 2014
2 parents 3396b98 + 47eba0e commit 288337b
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion statsmodels/tsa/base/tsa_model.py
Expand Up @@ -106,7 +106,7 @@ def _set_predict_start_date(self, start):
raise ValueError("Start must be <= len(endog)")
if start == len(dates):
self.data.predict_start = datetools._date_from_idx(dates[-1],
start, self.data.freq)
1, self.data.freq)
elif start < len(dates):
self.data.predict_start = dates[start]
else:
Expand Down
12 changes: 12 additions & 0 deletions statsmodels/tsa/tests/test_arima.py
Expand Up @@ -1897,6 +1897,18 @@ def test_arima00():
assert_raises(ValueError, ARIMA, y, (0,1,0))
assert_raises(ValueError, ARIMA, y, (0,0,0))

def test_arima_dates_startatend():
# bug
np.random.seed(18)
x = pandas.TimeSeries(np.random.random(36),
index=pandas.DatetimeIndex(start='1/1/1990',
periods=36, freq='M'))
res = ARIMA(x, (1, 0, 0)).fit(disp=0)
pred = res.predict(start=len(x), end=len(x))
assert_(pred.index[0] == x.index.shift(1)[-1])
fc = res.forecast()[0]
assert_almost_equal(pred.values[0], fc)

if __name__ == "__main__":
import nose
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb'], exit=False)

0 comments on commit 288337b

Please sign in to comment.