Appending new data with AutoReg component
thk3421-models opened this issue · 3 comments
first, I just want to thank you for building this awesome library. Very impressive and extremely useful.
I'm running into a bug where I cannot append new data to a DLM that has an AutoReg component. If I build the model without the AutoReg component, everything works. Here is an example of the problem:
dlm = pydlm.dlm(data['gross_revenue'].values)
dlm += pydlm.seasonality(period=7, w=0.95)
dlm += pydlm.autoReg(degree=2, discount=0.95)
dlm += pydlm.dynamic(features=[[x[0],x[1],x[2]] for x in features_matrix.values[:,:]], name='dau', discount=0.99)
dlm.fit() #so far so good at this point.
dlm.append([new_data['gross_revenue']], component='main') #this line yields the following error:
AttributeError: 'autoReg' object has no attribute 'appendNewData'
Perhaps I'm not implementing the update correctly? If I remove the AutoReg component, everything works. Any advice is greatly appreciated.
I can see that longSeason.py has this method, which is an automatic component. Perhaps a similar method needs to be added for the autoReg component? Thanks for any help or advice.
Thanks for raising the issue. This is a bug. autoReg
reads features from the main time series directly, so new need to call appendNewData
here. Added a placeholder to mitigate the error.
Thank you for the fix, I'll update and test it very soon. Much appreciated!