if (FALSE) {
data(FORMGMT.dat)
n <- nrow(FORMGMT.dat)
p <- 7 ##an intercept and six covariates
n.samples <- 500
## Below we demonstrate the conjugate function in the special case
## with improper priors. The results are the same as for the above,
## up to MC error.
beta.prior.mean <- rep(0, times=p)
beta.prior.precision <- matrix(0, nrow=p, ncol=p)
prior.shape <- -p/2
prior.rate <- 0
m.1 <-
bayesLMConjugate(Y ~ X1+X2+X3+X4+X5+X6, data = FORMGMT.dat,
n.samples, beta.prior.mean,
beta.prior.precision,
prior.shape, prior.rate)
summary(m.1$p.beta.tauSq.samples)
}
Run the code above in your browser using DataLab