I am having some difficulties online update the parameters. Hope someone could help me.
I have a hierarchical structure model. The output of the sampling is in the matrix form. Now I want to apply an algorithm that can update the columns of the output matrix.
What this algorithm does is:
- Run pm.sample with my model for 10 iterations.
- Use the last iteration to determine the number of rows of the parameter matrix.
- Using the updated row number to make changes to my parameter matrix and other related vector parameters. (There are multiplications between vector and matrices )
- Then we use these updated parameters as a starting sample to run a new MCMC sampling for 10 iterations.
- Repeat 2 to 4
I am wondering how to do such sampling while the size of matrices is changing for every 10 iterations. And how to set samples from the previous iteration as the starting point of the new sampling.
I hope I stated clearly. I appreciate it if anyone has an idea of how I can proceed with this.