
Simple Bayesian linear model with non-informative priors
bayesLMRef.RdGiven a lm object, the bayesLMRef function fits a
simple Bayesian linear model with reference (non-informative) priors.
Value
An object of class bayesLMRef, which is a list with at
least the following tag:
- p.beta.tauSq.samples
a
codaobject of posterior samples for the defined parameters.
References
Gelman, A., Carlin, J.B., Stern, H.S., and Rubin, D.B. (2004). Bayesian Data Analysis. 2nd ed. Boca Raton, FL: Chapman and Hall/CRC Press.
Author
Sudipto Banerjee sudiptob@biostat.umn.edu,
Andrew O. Finley finleya@msu.edu
Examples
if (FALSE) { # \dontrun{
set.seed(1)
n <- 100
X <- as.matrix(cbind(1, rnorm(n)))
B <- as.matrix(c(1,5))
tau.sq <- 0.1
y <- rnorm(n, X%*%B, sqrt(tau.sq))
lm.obj <- lm(y ~ X-1)
summary(lm.obj)
##Now with bayesLMRef
n.samples <- 500
m.1 <- bayesLMRef(lm.obj, n.samples)
summary(m.1$p.beta.tauSq.samples)
} # }