-
Notifications
You must be signed in to change notification settings - Fork 98
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
very slow on freq='D' or 365 #63
Comments
Hi @ahmad-shahi, could you share a bit more details? a 365 seasonality will create a 365-dimensional transition matrix. Running kalman filter with that means that you are doing a 365 dimensional matrix multiplication and inversion at every step, it is reasonable to take some time to finish. I tested it locally with 1000 data points and it finishes in roughly 30s. For 2000 data points, it finishes in roughly 68s and so on. Please let me know if this matches your observations Also, please make sure the seasonality of 365 is actually what you want. I assume you want to model the day-of-year pattern, but a seasonality of 365 might not give you that due to the existence of leap year. I would rather use the |
Hi, thanks for looking into the problem. My data is seasonal, starting in June and ending at the end of May, and this pattern is repeated. My data is a daily collection. based on your explanation, I believe will be still slow. However, your previous version was much faster. Thanks |
from pydlm import dlm, trend, seasonality A linear trendlinear_trend = trend(degree=1, discount=0.95, name='linear_trend', w=10) A seasonalityseasonal365 = seasonality(period=365, discount=0.99, name='seasonal365', w=10) Build a simple dlmsimple_dlm = dlm(time_series) + linear_trend + seasonal365 Fit the modelsimple_dlm.fit() Plot the fitted resultssimple_dlm.turnOff('data points') |
That's very interesting. Let me take a deeper look and see what is happenning here. Will keep you posted. |
I just did a quick profiling for a 1000-long time series, it seems most of the time was spent on the |
Hi @ahmad-shahi, I tested a few python and numpy versions with 1000 data points and 365 seasonality and didn't seem to find a better performing one.
I profiled the |
Thanks for the details and clarification. What is the alternative option to run DLM for the seasonality of 365? As you said using dynamic component, can you please share an example of how to use it? I did not find the example in the docs. Thanks again and appreciate your good work. |
Yeah, it's not currently implemented. The basica idea is to get a list of |
When I run pydlm on my data with daily collection and seasonality of 365. it is very very slow
The text was updated successfully, but these errors were encountered: