pydlm icon indicating copy to clipboard operation
pydlm copied to clipboard

forecast with regressors

Open tyokota opened this issue 6 years ago • 4 comments

Is it possible to forecast with regressors such as in the Google example? I first split the data into a train and valid set. I fit the train set. Then I conform the valid set regressors into a dictionary as such:

new_dict = {k:list(df[k].unique()) for k in df.columns}

However, I am seeing a NameError: The step is out of range error.

tyokota avatar Sep 10 '19 23:09 tyokota

Yes, it's possible, but you need to supply the data to the regressor before making prediction. The out of range error is caused by insufficient data in the regressor.

May I know how you supply the new features into the model? One way to do is via predictN and featureDict: https://github.com/wwrechard/pydlm/blob/a2bbfd97fb9285d131a6a8be82e0728ff2d4f567/pydlm/predict/dlmPredictMod.py#L86

wwrechard avatar Oct 22 '19 07:10 wwrechard

I'm having the same issue.
I have one predictor, and I'm trying to forecast out 3 days, so I've newf = {'x2':[[-0.13064217],[-0.13064217],[-0.13064217]]}

(predictMean, predicrVar) = drm.predictN(N=3,date=drm.n-1, featureDict=newf)

NameError: The step is out of range

I'm not sure what I'm doing wrong in setting up the future values of the predictor variable.

logisticregress avatar Jan 15 '20 01:01 logisticregress

Same here.

I try to output 12 months ahead (N=12) with the featureDict having 12 dynamic components. But I still get the NameError: The step is out of range. Could you please provide any insights?

Jill07217 avatar Mar 03 '20 23:03 Jill07217

same here. I am confused to use featuredict. any example of using this will be good

ramdhan1989 avatar Feb 14 '21 14:02 ramdhan1989