BUG: Fix small data issues for ARIMA. #1149

Merged
merged 5 commits into from Oct 25, 2013

Projects

None yet

4 participants

@jseabold
Member

This closes #1146 and #1046.

  1. We now check to make sure that we have at least one degree of freedom to estimate the problem. If so, then we try the estimation.
    1. Most / all of these estimations will return garbage. We have an extra check that we can estimate stationary initial params. Usually we can't in these cases, so the usual error will be raised here asking to set start_params. This should be enough of a warning to the user that this is "odd." If in the small chance the estimation goes through for a model with 5 observations and 1 degree of freedom, it's on the user then to determine things are no good.
  2. We now avoid the problem of maxlag >= nobs happening in the call to AR so this avoids the problem of #1046 that also presented itself as part of #1146.
@coveralls

Coverage Status

Coverage remained the same when pulling b70da1b on jseabold:fix-1146 into 1bc6576 on statsmodels:master.

@feathj
feathj commented Oct 25, 2013

This all looks good to me. Thanks again @jseabold

@josef-pkt
Member

Looks good to me (I'm not familiar with all places where you need the nobs check)

Do you need to adjust now also the test in #1046 or is this fixed with maxlag = nobs - 1 ?

(In case we would need to override the nobs check at some point in the future, it would be easy to add and option #1150)

@jseabold
Member

#1046 is handled by maxlag truncation. That's what I meant when I said we should never get to that failure in the first place.

In the event that we do get there somewhere, the size of the unsized object error should also never arise now that we don't squeeze down to scalars.

@jseabold
Member

I checked that it passed locally. We'll see what happens on the pythonxy builds.

@jseabold jseabold merged commit ff49a8e into statsmodels:master Oct 25, 2013

1 check passed

default The Travis CI build passed
Details
@jseabold jseabold added a commit that referenced this pull request Nov 23, 2013
@jseabold jseabold Backport PR #1149: BUG: Fix small data issues for ARIMA.
This closes #1146 and #1046.

1. We now check to make sure that we have at least one degree of freedom to estimate the problem. If so, then we try the estimation.
   1. Most / all of these estimations will return garbage. We have an extra check that we can estimate stationary initial params. Usually we can't in these cases, so the usual error will be raised here asking to set start_params. This should be enough of a warning to the user that this is "odd." If in the small chance the estimation goes through for a model with 5 observations and 1 degree of freedom, it's on the user then to determine things are no good.
2. We now avoid the problem of maxlag >= nobs happening in the call to AR so this avoids the problem of #1046 that also presented itself as part of #1146.
1eba381
@jseabold jseabold deleted the jseabold:fix-1146 branch Dec 31, 2013
@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