Variable Lag and slicing

Convert x to a TensorVariable first with x = pt.as_tensor(x) and then you can index it with pymc variables.

import pytensor.tensor as pt

You can also use pm.ConstantData to wrap your x as a tensor if you prefer

2 Likes