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

Same code+Data+Statsmodels Version -> Different Results #8717

Open
YueHaiming opened this issue Mar 4, 2023 · 5 comments
Open

Same code+Data+Statsmodels Version -> Different Results #8717

YueHaiming opened this issue Mar 4, 2023 · 5 comments

Comments

@YueHaiming
Copy link

Hello guys!

I was running a SARIMA (2,0,1)x(1,0,2)x24 model using my old laptop. It took around 20 to 30 seconds to finish and did not throw any warning. Python version is 3.9.7 and statsmodels version is 0.14.0.dev535.

I got a new laptop a couple of days ago. I installed Anaconda with default Python = 3.9.13. I used night wheels to install 0.14.0.dev535 statsmodels as well. I tried to install the same Numpy and Scipy, but I was not able to do that because of the Anaconda distribution issue (Numpy and Scipy are newer on the new laptop). I was expecting that the code would run faster because the new laptop has much powerful CPU and more cores. However, it took around 4-5 minutes to finish and throw warning "ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals". I tried different older versions of Scipy, some did converge but still took 4-5 minutes.

For both, I set maxiter at 10,000.

Can anyone help me to clarify the issue? Much appreciated!

@bashtage
Copy link
Member

bashtage commented Mar 4, 2023 via email

@YueHaiming
Copy link
Author

Do you have the same scipy versions? They have been changing optimizer code a lot recently and it isn't always helpful.

On Sat, Mar 4, 2023, 00:50 Haiming Yue @.> wrote: Hello guys! I was running a SARIMA (2,0,1)x(1,0,2)x24 model using my old laptop. It took around 20 to 30 seconds to finish and did not throw any warning. Python version is 3.9.7 and statsmodels version is 0.14.0.dev535. I got a new laptop a couple of days ago. I installed Anaconda with default Python = 3.9.13. I used night wheels to install 0.14.0.dev535 statsmodels as well. I tried to install the same Numpy and Scipy, but I was not able to do that because of the Anaconda distribution issue (Numpy and Scipy are newer on the new laptop). I was expecting that the code would run faster because the new laptop has much powerful CPU and more cores. However, it took around 4-5 minutes to finish and throw warning "ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals". I tried different older versions of Scipy, some did converge but still took 4-5 minutes. For both, I set maxiter at 10,000. Can anyone help me to clarify the issue? Much appreciated! — Reply to this email directly, view it on GitHub <#8717>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKTSRIEPNDCB7XW5SQVVH3W2KGXBANCNFSM6AAAAAAVPG2ITM . You are receiving this because you are subscribed to this thread.Message ID: @.>

Thank you for your relpy. Yes, I installed the same Scipy version. It did converge but still took 4-5 minutes compared with 20-30s on my old laptop. I am super confused...

@bashtage
Copy link
Member

bashtage commented Mar 6, 2023

One difference is probably the linear algebra version. Which CPUs were in the old and new?

@YueHaiming
Copy link
Author

One difference is probably the linear algebra version. Which CPUs were in the old and new?

Hi, sorry for my late reply. Old has i7-8650U and New has i9-12900HK. It is a huge upgrade. Do you think linear algebra version (in numpy) can cause so big difference? 20-30 seconds slowed down to 4-5 minutes? Thank you!

@ckwan48
Copy link

ckwan48 commented Mar 17, 2023

Do you have the same scipy versions? They have been changing optimizer code a lot recently and it isn't always helpful.

On Sat, Mar 4, 2023, 00:50 Haiming Yue @.> wrote: Hello guys! I was running a SARIMA (2,0,1)x(1,0,2)x24 model using my old laptop. It took around 20 to 30 seconds to finish and did not throw any warning. Python version is 3.9.7 and statsmodels version is 0.14.0.dev535. I got a new laptop a couple of days ago. I installed Anaconda with default Python = 3.9.13. I used night wheels to install 0.14.0.dev535 statsmodels as well. I tried to install the same Numpy and Scipy, but I was not able to do that because of the Anaconda distribution issue (Numpy and Scipy are newer on the new laptop). I was expecting that the code would run faster because the new laptop has much powerful CPU and more cores. However, it took around 4-5 minutes to finish and throw warning "ConvergenceWarning: Maximum Likelihood optimization failed to converge. Check mle_retvals". I tried different older versions of Scipy, some did converge but still took 4-5 minutes. For both, I set maxiter at 10,000. Can anyone help me to clarify the issue? Much appreciated! — Reply to this email directly, view it on GitHub <#8717>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKTSRIEPNDCB7XW5SQVVH3W2KGXBANCNFSM6AAAAAAVPG2ITM . You are receiving this because you are subscribed to this thread.Message ID: @.>

I've been having similar issues with SARIMAX and it uses the numerical solver lbgfs, do you think scipy has any impact on this, too?

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

No branches or pull requests

3 participants