How do I make future predictions in a time series model with out of sample data?

Hi! Pretty sure the answer is to define the coords within the model context, and not passed to the context manager.

WRONG:

coords = {'c':c}
with pm.Model(coords = coords) as model:
    etc...

RIGHT:

with pm.Model() as model:
    model.add_coord('c',c, mutable = True)

Then, when setting out of sample data:

with model:
     model.set_data({'data':data}, coords = {'c':new_c})

See:

https://www.pymc.io/projects/docs/en/latest/api/generated/pymc.set_data.html

The fact that you can set coords through the model.set_data() method isn’t well documented.

I had a more detailed example but the page refreshed, hope this helps.