The 365 Data Science team is proud to invite you to our own community forum. A very well build system to support your queries, questions and give the chance to show your knowledge and help others in their path of becoming Data Science specialists.
Ask
Anybody can ask a question
Answer
Anybody can answer
Vote
The best answers are voted up and moderated by our team

Time series Analysis In Python Section 7 Jupyter Notebook doesn’t work

Time series Analysis In Python Section 7 Jupyter Notebook doesn’t work

Super Learner
0
Votes
2
Answer

For the LLR test part, the function doesn’t work, I tried to download the new file and it still doesn’t work, can anyone help me with this?

2 Answers

365 Team
0
Votes

Hi Keyu,
Thanks for reaching out!
If you remove the “.fit()” from the LLR test function, you have to use the already fitted “results” variables instead of the “model” ones.
Hope this helps!
Best,
Iliya

Hi, Iliya, I did not remove the “.fit()” from the LLR test function, this is what I got with the completed version of the file and I did not change anything att all. would you mind write down the code in this comment section?

3 weeks

365 Team

Hey Keyu,

Sorry for the delayed response, but I was out of the office over the festive period.

Anyhow, the issue here comes from the release of a newer version of statsmodels than the one the code was initially created on. The simplest solution is the what Iliya had already advised – remove “.fit()” and use the “results” variables over the “model” variables.
In other words, rewrite the LLR_test function to use:

L1 = mod_1.llf
L2 = mod_2.llf

rather than:

L1 = mod_1.fit().llf
L2 = mod_2.fit().llf

Then, when you actually call the function, you’d be using the “results” variables, so:

LLR_test(results_ar_2, results_ar_3)

instead of:

LLR_test(model_ar_2, model_ar_3)

Python returns an error when fitting the same model twice, so we work around this issue by using the fitted results in the LLR_test instead.

Hope this helps!

Best,
365 Vik