Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] ARIMA model (CSS fitting) #174

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

Sburyachenko
Copy link
Contributor

Reference Issues/PRs

What does this implement/fix? Explain your changes.

ARIMA model fitted with conditional sum of squares approximation.

Any other comments?

@deatinor
Copy link
Contributor

deatinor commented May 4, 2020

The two notebooks in the example folder are not necessary.

I would keep the ARIMA documentation as internal reference. What is the purpose of the other one?

gtime/forecasting/arima.py Outdated Show resolved Hide resolved
from gtime.forecasting import ARIMAForecaster


class TestNaiveModel(SimplePipelineTest):
Copy link
Contributor

Choose a reason for hiding this comment

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

These tests are not enough to test well ARIMA

Copy link
Contributor

@deatinor deatinor left a comment

Choose a reason for hiding this comment

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

I still need to review the part in stat_tools.
I see also better what you did. The tests in forecasting package are less important since the core is in stat_tools. If you manage you can add a couple of tests without using hypothesis, so it's easier.

Regarding stat_tools I'm not sure if it's a good idea to create a new package in this way, but I think we can postpone the decision since it will depend on the future directions of the library.

model = ARMAMLEModel((self.n_ar, self.n_ma), self.method)
model.fit(np_x)
self._set_params(model, np_x)
super().fit(X, y)
Copy link
Contributor

Choose a reason for hiding this comment

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

It is not clear to me why you call two times a fit function. Can you explain it to me?

gtime/forecasting/arima.py Outdated Show resolved Hide resolved
gtime/forecasting/arima.py Outdated Show resolved Hide resolved
X: np.array, difference of ``self.order[1]`` order of X

"""
n = len(X)
Copy link
Contributor

Choose a reason for hiding this comment

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

No need of this variable since is it used only one time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I still need to store it because after that length of X changes as I add previous values for AR

gtime/forecasting/arima.py Outdated Show resolved Hide resolved
gtime/forecasting/arima.py Outdated Show resolved Hide resolved
gtime/forecasting/arima.py Outdated Show resolved Hide resolved
gtime/forecasting/arima.py Outdated Show resolved Hide resolved
return eps


class ARIMAForecaster(SimpleForecaster):
Copy link
Contributor

Choose a reason for hiding this comment

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

I refactored the simple models calling them naive.
Also, I'm not sure about inheriting from the parent class of the naive forecasters. Either we create a parent class for the arima forecasters or we create a parent class for all the forecasters

gtime/forecasting/arima.py Outdated Show resolved Hide resolved
@deatinor deatinor force-pushed the master branch 3 times, most recently from 03fc53f to 3b881b2 Compare July 10, 2020 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants