posterior: Generate Posterior Simulations

Description Usage Arguments Value Author(s) References Examples

View source: R/posterior.R

Description

Generate posterior simulations for a given fitted linear or general linear model, assuming the standard "noninformative" priors on the unknowns.

Usage

1
posterior(obj, ...)

Arguments

obj

an object

...

further arguments

Value

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.

Author(s)

Jouni Kerman jouni@kerman.com

References

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").

Examples

1
2
3
4
5
6
7
  ## Not run: 
  x <- 1:20
  y <- rnorm(length(x), mean=x, sd=10)
  print(summary(fit <- lm(y ~ x)))
  bayes.estimates <- posterior(fit)
  
## End(Not run)

jsta/rv documentation built on Feb. 12, 2022, 5:13 p.m.