BUG: Allow 1d exog in ARMAX forecasting. #1077

Merged
merged 4 commits into from Oct 23, 2013

Projects

None yet

3 participants

@jseabold
Member

Closes #1076. Another candidate for backporting.

@josef-pkt josef-pkt and 1 other commented on an outdated diff Oct 22, 2013
statsmodels/tsa/arima_model.py
@@ -203,6 +206,8 @@ def _get_predict_out_of_sample(endog, p, q, k_trend, k_exog, start, errors,
if k_exog > 0:
#TODO: technically should only hold for MLE not
# conditional model. See #274.
+ if np.ndim(exog) == 1: # ensure 2-d for conformability
+ exog = exog[:,None]
@josef-pkt
josef-pkt Oct 22, 2013 Member

I think this goes contrary to what we do in other cases of predict, IIRC
exog = exog[None, :]

should there be an additional check if len(exog) == self.exog.shape[0] and do conditional reshaping?

@josef-pkt
josef-pkt Oct 22, 2013 Member

I don't remember where we discussed this. Right now I can only see MultinomialModel.predict which has a reshape if ndim==1

@jseabold
jseabold Oct 23, 2013 Member

Yes, I recall but not where either. I think you're right. Fix pushed. Good catch.

@josef-pkt
Member

not my area, so just a comment about consistency

@jseabold
Member

Rebased.

@coveralls

Coverage Status

Changes Unknown when pulling 8a22617 on jseabold:fix-armax-predict into * on statsmodels:master*.

@coveralls

Coverage Status

Coverage remained the same when pulling 8a22617 on jseabold:fix-armax-predict into c1b665a on statsmodels:master.

@jseabold jseabold merged commit 54a0e9e into statsmodels:master Oct 23, 2013

1 check passed

default The Travis CI build passed
Details
@jseabold jseabold deleted the jseabold:fix-armax-predict branch Oct 23, 2013
@josef-pkt josef-pkt referenced this pull request Nov 21, 2013
Closed

bugfix release 0.5.1 #1079

@jseabold jseabold added a commit that referenced this pull request Nov 23, 2013
@jseabold jseabold Backport PR #1077: BUG: Allow 1d exog in ARMAX forecasting.
Closes #1076. Another candidate for backporting.
c944f98
@yarikoptic yarikoptic added a commit to yarikoptic/statsmodels that referenced this pull request Oct 23, 2014
@yarikoptic yarikoptic Merge commit 'v0.5.0-13-g8e07d34' into debian
* commit 'v0.5.0-13-g8e07d34':
  Backport PR #1200: BLD: do not install *.pyx *.c  MANIFEST.in
  Backport PR #1157: Tst precision master
  Backport PR #1149: BUG: Fix small data issues for ARIMA.
  Backport PR #1125: REF/BUG: Some GLM cleanup. Used trimmed results in NegativeBinomial variance.
  Backport PR #1124: BUG: Fix ARIMA prediction when fit without a trend.
  Backport PR #1117: Update ex_arma2.py
  Backport PR #1089: ENH: exp(poisson.logpmf()) for poisson better behaved.
  Backport PR #1077: BUG: Allow 1d exog in ARMAX forecasting.
  Backport PR #1075: BLD: Fix build issue on some versions of easy_install.
  Backport PR #1071: Update setup.py to fix broken install on OSX
  Backport PR #1057: COMPAT: Fix py3 caching for get_rdatasets.
  BUG: fix predict (was refactoring victim)
985a57e
@yarikoptic yarikoptic added a commit to yarikoptic/statsmodels that referenced this pull request Oct 23, 2014
@yarikoptic yarikoptic Merge remote-tracking branch 'origin/maintenance/0.5.x' into releases
* origin/maintenance/0.5.x: (1875 commits)
  Backport PR #1200: BLD: do not install *.pyx *.c  MANIFEST.in
  Backport PR #1157: Tst precision master
  Backport PR #1149: BUG: Fix small data issues for ARIMA.
  Backport PR #1125: REF/BUG: Some GLM cleanup. Used trimmed results in NegativeBinomial variance.
  Backport PR #1124: BUG: Fix ARIMA prediction when fit without a trend.
  Backport PR #1117: Update ex_arma2.py
  Backport PR #1089: ENH: exp(poisson.logpmf()) for poisson better behaved.
  Backport PR #1077: BUG: Allow 1d exog in ARMAX forecasting.
  Backport PR #1075: BLD: Fix build issue on some versions of easy_install.
  Backport PR #1071: Update setup.py to fix broken install on OSX
  Backport PR #1057: COMPAT: Fix py3 caching for get_rdatasets.
  BUG: fix predict (was refactoring victim)
  DOC: Update release notes with maint branch changes.
  MAINT: Fix mailmap entry.
  BUG: fix warning arguments in GenericLikelihoodModel
  MAINT: Add name to .mailmap.
  ENH: Pandas Series no longer inherits from ndarray. Closes #1036.
  TST: Fixed test for Anaconda on Windows
  TST: Make test compatible with pandas 0.7.x
  BUG: Fail gracefully when not enough obs given for order.
  ...
7ae7ee7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment