-
-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add time varying transition probabilities for DiscreteMarkovChain #392
Comments
While conceptually it is not hard the API will be tricky because we have 4+ dimensions with different meanings all in the same transition array: We also don't allow time varying parameters in any PyMC time series and ask users to implement a CustomDist when they need it to keep our API simpler. We can offer it but need to decide how to do it. Add a time_varying flag to know dimension x will be time and not lags or batch? |
Also time varying parameters tend to be impractical with large time series. Usually you don't really want to define a unique transition per time step but something that changes after x steps or cycles back and forth or is parametrized at runtime by another variable. Again for this it would be better to define your custom implementation. The pre built distribution couldn't offer this functionality without basically reinventing Scan |
I'm a llittle bit more bullish on this. I do something similar in the kalman filters, where I inspect the incoming matrices and check if there's a batch dimension. If there is, the variable is assigned to Right now, |
batch dim could just be a batch dimension, which we should definitely support as that's the case in all our distributions. When you write If you always assume the dim before lags is time, users will need to add a dummy one to skip it and distinguish from the first batch dimension. That's not a big problem, the point is you need to disambiguate when you don't want time varying effects, either with a dummy dim or a flag I'm still suspecting that in most cases you probably want something that's parametrized inside the scan step to avoid allocating huge arrays outside of the scan. If we think I'm wrong I don't have any other objection. The example in the discourse you wrote fits my suspicion though. Only two matrices that cycle back and forth |
Hi. Jesse Grabowski recommended I raise an issue here based on a question I asked in PyMC discourse. Would it be possible to add capacity for time-varying transition probabilities in the
DiscreteMarkovChain
class? For my own purposes, I would like to use this to use a different transition matrix on a few designated transitions while using the 'main' on on others, but it's possible to imagine a number of possible use cases.The text was updated successfully, but these errors were encountered: