|
I know it's quite basic, but I want to know if any of you has a good tutorial where they approach Gibbs sampling by sampling from the parameter distribution of a linear regression using Normal Distributions. I know Gibbs sampling is less efficient that direct inference (which is super easy and has a closed form) I just want to write some code on that to get a better grasp on sampling techniques Thanks |
Does it have to be a Gibbs sampler? Metropolis algorithms seem to make more sense in this case because all weights would have to be sampled separately otherwise, if I'm not mistaken.
Edit: Apparently Gibbs sampling is not that as inefficient as I thought: www.biostat.umn.edu/~sudiptob/ph8472/BayesianLinearModel.pdf
It was more like a toy problem, I want to analyze what's really happening inside the sampler. So I used something easy
You could also implement a metropolis sampler to sample from a two dimensional Gaussian so you can plot things and visually inspect the algorithm. Not much work and sort of fun to watch and play with, in my opinion.