wwrechard / pydlm

A python library for Bayesian time series modeling
BSD 3-Clause "New" or "Revised" License
475 stars 98 forks source link

AutoRegression failing with lag value >1 #20

Closed gcgibson closed 6 years ago

gcgibson commented 6 years ago

When running

simple_dlm = dlm(data) + autoReg(degree=3, data=data, name='ar3', w=1.0) simple_dlm.fit()

I get

Traceback (most recent call last):
  File "final.py", line 81, in <module>
    simple_dlm.plotPredictN(date=780, N=51)
  File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 1139, in plotPredictN
    N=N, date=date, featureDict=featureDict)
  File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 379, in predictN
    (obs, var) = self.continuePredict(featureDict=featureDictOneDay)
  File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 328, in continuePredict
    return self._continuePredict(featureDict=featureDict)
  File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/func/_dlm.py", line 441, in _continuePredict
    extra = comp.d - len(self.predictStatus[2])
AttributeError: dlm instance has no attribute 'predictStatus'

however, setting ar=1 seems to work fine.

wwrechard commented 6 years ago

This should have been fixed in the last commit with the current github version. I don't have my laptop in my hand. Could you give it a try? Thanks a lot!

I will also verify it once I have access to my laptop. On Thu, Sep 28, 2017 at 4:58 PM Casey Gibson notifications@github.com wrote:

When running

simple_dlm = dlm(data) + autoReg(degree=3, data=data, name='ar3', w=1.0) simple_dlm.fit()

I get

Traceback (most recent call last): File "final.py", line 81, in simple_dlm.plotPredictN(date=780, N=51) File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 1139, in plotPredictN N=N, date=date, featureDict=featureDict) File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 379, in predictN (obs, var) = self.continuePredict(featureDict=featureDictOneDay) File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/dlm.py", line 328, in continuePredict return self._continuePredict(featureDict=featureDict) File "/Users/gcgibson/anaconda/lib/python2.7/site-packages/pydlm/func/_dlm.py", line 441, in _continuePredict extra = comp.d - len(self.predictStatus[2]) AttributeError: dlm instance has no attribute 'predictStatus'

however, setting ar=1 seems to work fine.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/wwrechard/pydlm/issues/20, or mute the thread https://github.com/notifications/unsubscribe-auth/AIDNcvryNnd6QOSqaJ_XwA8jHED8uWahks5snDKIgaJpZM4PoCYB .

gcgibson commented 6 years ago

Awesome thanks! It works!