RJT1990 / pyflux

Open source time series library for Python
BSD 3-Clause "New" or "Revised" License
2.1k stars 240 forks source link

Predict Function Clarification #90

Open broble1 opened 7 years ago

broble1 commented 7 years ago

I am looking for some clarification on how the Predict function works in your program. With the following code am I correct in assuming that I am getting the prediction for the next period from the previous data? So, if i = 30 is df_pred.loc[i,'UD'] returning the prediction for dfg.loc[i,'UD'] or dfg.loc[i+1,'UD']? Thank you.

for i in dfg.index: if i >= 30: data = dfg[i-30:i] model = pf.GARCH(data,p=3,q=3) x = model.fit(method='MLE') df_pred = model.predict(h=1) dfg.loc[i,'G_Pred_UD']= df_pred.loc[i,'UD']