How to store the constant term in policy and transition func

You need to be more explicit. Is y a model variable? If yes, use the simult_ function to generate the data within a loop. For looping, see [Loop over parameters)