Skip to content

Allows start_params input in ARMA.fit() to be a function which takes … - #2533

Closed
chelleych wants to merge 2 commits into
statsmodels:masterfrom
chelleych:arima_start_params
Closed

chelleych wants to merge 2 commits into
statsmodels:masterfrom
chelleych:arima_start_params

Conversation

@chelleych

Copy link
Copy Markdown
Contributor

…an ARMA model and returns start_params. In response to #2521

@josef-pkt

Copy link
Copy Markdown
Member

We need a test case for this. The change itself looks innocent, except I don't remember whether __call__ works across all supported python versions.

If merging this is not urgent, I'd rather merge for 0.8. (Mainly to have time to think about this, not because there is any worry about the actual change.)

@jseabold any comment?

Comment thread statsmodels/tsa/arima_model.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could add array-like, callable, optional

@chelleych

Copy link
Copy Markdown
Contributor Author

Do you mean that I should have added a test case to tsa/tests/test_arima.py ?

The change isn't urgent. I do think it's a rather strange addition, though it would be useful for me. I use a modified version of the _fit_start_params_hr function, but can otherwise just pass my own start_params from my modified function, so this addition is not absolutely necessary.

As an alternative, I could make contributions which add more options to _fit_start_params using different methods, as I know many people have run into problems with start_params being non-invertible or non-stationary when the start_params could have been acceptable if obtained with the long AR method rather than the Hannan-Rissanen method.

@josef-pkt

Copy link
Copy Markdown
Member

Do you mean that I should have added a test case to tsa/tests/test_arima.py ?

Yes, It could be just adding a fit with a simple callable to an existing test case, and checking that params are still ok.
The main point for testing is to see if it works across python versions, checked by TravisCI, and to prevent future refactoring victims.

Any improvements and more options to select start_params would benefit more users, and would, for sure, be welcome.

changed from hasattr to callable
@bashtage

Copy link
Copy Markdown
Member

Closing since this adds a lot of complexity for only a small amount of convenience.

@bashtage bashtage closed this Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants