Description Usage Arguments Details Value Author(s) References Examples

Given a `lm`

object, the `bayesLMRef`

function fits a
simple Bayesian linear model with reference (non-informative) priors.

1 | ```
bayesLMRef(lm.obj, n.samples, ...)
``` |

`lm.obj` |
an object returned by |

`n.samples` |
the number of posterior samples to collect. |

`...` |
currently no additional arguments. |

See page 355 in Gelman et al. (2004).

An object of class `bayesLMRef`

, which is a list with at
least the following tag:

`p.beta.tauSq.samples` |
a |

Sudipto Banerjee [email protected],

Andrew O. Finley [email protected]

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.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ```
## Not run:
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)
## End(Not run)
``` |

spBayes documentation built on July 20, 2017, 1:02 a.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.