Generate posterior simulations for a given fitted linear or general linear model, assuming the standard "noninformative" priors on the unknowns.
posterior(obj, ...)
an object
further arguments
A (named) list of random vectors. For example, the lm
method
returns a list with components sigma
(the residual s.d.) and
beta
, the regression coefficients.
Kerman, J. and Gelman, A. (2007). Manipulating and Summarizing Posterior Simulations Using Random Variable Objects. Statistics and Computing 17:3, 235-244.
See also vignette("rv")
.
# NOT RUN {
# }
# NOT RUN {
x <- 1:20
y <- rnorm(length(x), mean=x, sd=10)
print(summary(fit <- lm(y ~ x)))
bayes.estimates <- posterior(fit)
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab