using gibbs sampling to fit latent variables and parameters of an AR(1) model