Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Appending new data with AutoReg component #37

Open
thk3421-models opened this issue Aug 5, 2019 · 3 comments
Open

Appending new data with AutoReg component #37

thk3421-models opened this issue Aug 5, 2019 · 3 comments

Comments

@thk3421-models
Copy link

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.

@thk3421-models
Copy link
Author

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.

@wwrechard
Copy link
Owner

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.

@thk3421-models
Copy link
Author

Thank you for the fix, I'll update and test it very soon. Much appreciated!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants