Hello:
I believe there is a bug in bayesglm.R. I attached bayesglm_A_1.R where I inserted a few cat statements. If you run it using the code from the other file, you'll see from the output that the last two weights that correspond to pseudo-data are initialized but never updated.
The problem is that in .bayesglm.fit.loop.updateState() the working weights are computed as:
w.star <- c(w, sqrt(state$dispersion)/priors$scale)
but to update them one needs to use state$prior.sd in the denominator, which should be equal to priors$scale only in the beginning. It looks like you only need to change one line to fix it.
Regards,
Nik Tuzov
bayesglm_issue.zip