Hi everyone. I am trying to implement Stick-breaking Construction of the Indian Buffet Process and use it as a prior to my model. I was told by a member of this group that I could ask my questions about sampling different method in this forum. It is my first experience of writing my own sampler. I am a bit confused and have a problem to convert the formulations in the paper to a piece of working code. I will appreciate if you could give me some advices. As a starting point, I am not sure, how I should use slice sampler for updating s parameter (equation 21). Could anybody kindly clear it up more for me? Thanks in advance.
You can specific a sampler by doing
with pm.Model():
...
step = pm.Slice(vars=[s])
...
There is an example here http://docs.pymc.io/notebooks/api_quickstart.html?highlight=sampler (see cell [33]
)
In general, if you specify a sampler for each of the RVs in the model, PyMC3 will sample it in a Gibbs like fashion in the backend. However, please be very careful to analysis the result, as I am not sure the detailed balance and geometric ergodicity etc are always hold.