The 365 Data Science team is proud to invite you to our own community forum. A very well built 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

ERROR in code: Fitting Higher Lag AR Models for Prices

ERROR in code: Fitting Higher Lag AR Models for Prices

0
Votes
1
Answer

The error exists even in the completed version of the notebook.
Path:
Time Series Analysis in Python
The Autoregressive (AR) Model
Fitting Higher Lag AR Models for Prices
Notebook:
Section 7 (Prices) – The AR Model – Completed

LLR Test
def LLR_test(mod_1, mod_2, DF = 1):
L1 = mod_1.fit().llf
L2 = mod_2.fit().llf
LR = (2*(L2-L1))
p = chi2.sf(LR, DF).round(3)
return p
LLR_test(model_ar_2,model_ar_3)
ValueError: x contains a constant. Adding a constant with trend=’c’ is not allowed.

1 Answer

365 Team
0
Votes

Hey Akos, 
 
This question has already been answered in the Q&A Hub. https://365datascience.com/question/comparing-higher-lag-ar-models/
 
Best,
365 Vik