Deleting / replacing RVs


#1

Is it possible to replace a RV after it has been created the usual way? e.g. var = pm.Beta('var', 1, 1)

Suppose later on, I wish to redefine var = pm.Normal('var', 0, 1)

Currently, doing so would invoke an error:

>>>ValueError: Variable name var already exists.

I can’t seem to see how to delete RV from PyMC3 either.

Is this currently possible in PyMC3? I suspect there may be an issue in implementing this sort of functionality due to the way in which PyMC3 deals with RVs, automatically building it into pm.Model().

Thoughts?


#2

I think you can use theano.clone to modify the underly theano computational graph, but I dont know exactly how you can to do that as well.