I am trying to do Gibbs sampling on a model with 6 parameters/variables to tune. I have a conditional posterior that i can code as follows:
define a module model.py
Inside model.py define
@pm.stochastic
def model_log_posterior(value=np.ones): # i pass an array/vector of my variables at a stage
post = comp_post(value) # say comp_post is another function which takes place amicably
return post
Once i run the sampler on this, it works fine and i can see the trace using:
sampler.trace(‘model_log_posterior’)[:]
i do see a trace of ‘num_samp’ for 6 variables.
My question is:
does pymc recognize that there are 6 different variables to tune.
i know that gibbs step method needs to be defined by me by subclassing the Gibbs in pymc. But for the moment all i want to know is if pymc is doing the right thing here?
i am trying to read the code to trace where everything happens but have been unable to do so properly thus far. any help would be much appreciated.
Greetings all!
I am trying to do Gibbs sampling on a model with 6 parameters/variables to tune. I have a conditional posterior that i can code as follows:
Once i run the sampler on this, it works fine and i can see the trace using:
sampler.trace(‘model_log_posterior’)[:] i do see a trace of ‘num_samp’ for 6 variables.
My question is: does pymc recognize that there are 6 different variables to tune. i know that gibbs step method needs to be defined by me by subclassing the Gibbs in pymc. But for the moment all i want to know is if pymc is doing the right thing here?
i am trying to read the code to trace where everything happens but have been unable to do so properly thus far. any help would be much appreciated.
Thank you for your attention.