Skip to content
Prev 323187 / 398503 Next

How to calculate Hightest Posterior Density (HPD) of coeficients in a simple regression (lm) in R?

Richard Asturia <richard.asturia <at> gmail.com> writes:
Hmmm. 
  At least for lm(), if the assumptions of the model are met
then the sampling distribution of the parameters should be
multivariate normal, so with a flat prior the posterior distributions
should be symmetric and equivalent to the sampling distributions of
the parameters -- so I think that the highest 95% posterior density
interval should be equivalent to classical frequentist confidence
intervals [see confint()].

  You might be interested in the bayeslm() function from the arm
package.