-
-
Save dpbac/9d4adfed0a7c05a2f10a76ddb676a13e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create empty list to store search results | |
order_aic_bic=[] | |
# Loop over p values from 0-6 | |
for p in range(7): | |
# Loop over q values from 0-6 | |
for q in range(7): | |
# create and fit ARMA(p,q) model | |
model = SARIMAX(df_store_2_item_28_time, order=(p,1,q), freq="D") #because adf test showed that d=1 | |
results = model.fit() | |
# Append order and results tuple | |
order_aic_bic.append((p,q,results.aic, results.bic)) | |
# Construct DataFrame from order_aic_bic | |
order_df = pd.DataFrame(order_aic_bic, | |
columns=['p','q','AIC','BIC']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment