Skip to content

prevent _make_arma_names from adding exog_names when already present - #2526

Merged
josef-pkt merged 2 commits into
statsmodels:masterfrom
kiyoto:stop-arima-exog-names-expand
Jul 12, 2015
Merged

josef-pkt merged 2 commits into
statsmodels:masterfrom
kiyoto:stop-arima-exog-names-expand

Conversation

@kiyoto

@kiyoto kiyoto commented Jul 11, 2015

Copy link
Copy Markdown
Contributor

closes #1691

I have some doubts about my approach here. It looks like exog_names was added to address Issue #626 back in the day, but it almost seems to assume that _make_arma_names (and hence fit) is run at most once against the model.

@josef-pkt

Copy link
Copy Markdown
Member

We still have the trend choice as argument in fit.
If users calls fit a second time with different trend, then this will not work, AFAICS.

It will work for repeated calls with identical keywords

@josef-pkt

Copy link
Copy Markdown
Member

I think having trend as fit argument is still a mistake. We cannot have two results instances with different trend option with the same model instance, I guess.

If we remove trend from fit arguments, then there is no need anymore to create the parameter names repreatedly.

I think we should merge this for 0.7 to fix the bug for the main usecase when we call fit repeatedly with different optimizer options and starting values. This case looks properly covered by this PR.

Comment thread statsmodels/tsa/tests/test_arima.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.

to make the test stronger, you can copy the same assert_equal also after the first call to fit

@kiyoto

kiyoto commented Jul 12, 2015

Copy link
Copy Markdown
Contributor Author

@josef-pkt Thanks.

If users calls fit a second time with different trend, then this will not work, AFAICS.

You are right. It's possible to handle, but it means leaking the logic of vector_ar/util.py:make_lag_names into _make_arma_names (also, I don't think trend_name should be calculated inside make_lag_names). All that said, it should be a separate conversation.

@josef-pkt

Copy link
Copy Markdown
Member

I'm merging this as the first step to the more general fix.

josef-pkt added a commit that referenced this pull request Jul 12, 2015
BUG: prevent _make_arma_names from adding exog_names when already present
@josef-pkt
josef-pkt merged commit ecbc1e8 into statsmodels:master Jul 12, 2015
@kiyoto
kiyoto deleted the stop-arima-exog-names-expand branch July 12, 2015 21:22
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.

BUG: ARIMA exog_names expands in each fit.

2 participants