Variable Lag and slicing

Most helpful, thank you! Replacing import aesara.tensor as at with import pytensor.tensor as pt solved the issue.