Repository navigation
ENH: Add new method to generate starting params - #3084
Conversation
| mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1]) | ||
| assert_equal(mod.exog_names, ['const', 'ar.L1.y', 'ma.L1.y', 'ma.L2.y']) | ||
| with warnings.catch_warnings(record=True) as w: | ||
| mod.fit(disp=0, start_params=[np.mean(y), .1, .1, .1]) |
There was a problem hiding this comment.
Does this not raise a warning anymore?
Do you have an idea what changed?
There was a problem hiding this comment.
maybe rebase error
bashtage@dff5609#diff-d0f09cb33612798898f77abc2f5ec297
There was a problem hiding this comment.
The warning doesn't show up in the test run. But I don't know if there is no warning anymore, or whether it is not set to always warn
|
I think it's better if we merge this (after fixing some details). It doesn't fix all the problems with the underlying code, but at least gives the option to work around some of them. |
Added ability to use the long AR method in fitting ARIMA start_params Improved tests. Fixed case where longar_maxlag is greater than length of series Changed longar_start_params variable name to start_ar_lags closes statsmodels#2550
d2ed8c7 to
1854d86
Compare
| the Results object's mle_retvals attribute. Output is dependent | ||
| on the solver. See Notes for more information. | ||
| disp : bool, optional | ||
| disp : int, optional |
There was a problem hiding this comment.
This was raising a warning in PyCharm since it was incorrectly labeled as bool
There was a problem hiding this comment.
My guess is that this depends on the scipy optimizer, but lbfgsb has numeric options.
|
No warnings are issued. I have no idea why those were there. In general one should always check the error is raised when catching warnings. |
1854d86 to
3250892
Compare
|
Recent Pythons get an error |
| exog = np.asarray(exog) | ||
| if self.k_exog == 1 and exog.ndim == 1: | ||
| exog = exog[:, None] | ||
| # we need the last k_ar exog for the lag-polynomial |
There was a problem hiding this comment.
this part here is redundant/duplicate. It is now included in the lines just above under if exog is not None
|
Given that python 3.4 shows the warning, the |
cc7a44c to
16f8890
Compare
|
statsmodels/statsmodels/base/model.py Line 446 in d2de2f0 Is not correct. There are many models in the test suite that have indefinite Hessians. This code will only show problems is an eigenvalue is very lose to 0, but when there are both + and - eigenvalues inv "work". See for all of the tests that have been incorrectly using indefinite Hessians. |
|
To understand The numbers printing are the maximum and minimum eigenvalue of |
|
I'm not sure I understand. First rebasing, amending or squashing during review makes it very difficult to follow what's going on. About Hessian with negative eigenvalues: |
I don't like writing commit messages. |
16f8890 to
9cbc0e0
Compare
|
Back to passing, but ignoring the big issue. If an explicit eigenvalue check is put in when convputing the inverse Hessian, there are many examples that have indefinite Hessians. |
|
The bigger issue is that warning catchers should not be allowed unless the source of the warning is fully understood and the warning is fully reproducible across platforms. If the warning differs depending on other modules (e.g. NumPy) then there should be a compat fix to unify the behavior. |
|
roughly: It takes a few seconds to write a commit message, and half an hour for a reviewer to figure out what changed. (I'm also amending commits and force pushing, but not during review. Which is an empty statement because I usually don't get reviews.) |
open new issues with what should be changed so it doesn't get lost in PR discussion. Right now we have no guarantee about consistent behavior in corner cases across machines, operating system, linalg libraries or versions of dependencies. For example, scipy optimizers change all the time, sometimes it handles a case better, sometimes worse. Differences in BLAS/LAPACK libraries can have quite large effects in edge cases. |
9cbc0e0 to
bf8a72b
Compare
a43afc4 to
a866399
Compare
Add correct type to disp
a866399 to
652bf5c
Compare
Remove redundant lines that entered on rebase
|
Thanks @chelleych @bashtage AFAICS, this should be good to backport to 0.8. |
…gar_start_params ENH: Add new method to generate starting params (fixed lags for hr start ar)
Added ability to use the long AR method in fitting ARIMA start_params
Improved tests. Fixed case where longar_maxlag is greater than length of
series
Changed longar_start_params variable name to start_ar_lags
closes #2550