restrictedBayesLm: MCMC algorithm for Restricted Likelihood Bayesian Linear...

Description Usage Arguments Details Value

View source: R/fn_restrictedBayesLm.R

Description

Fits the linear regression model β~N(μ_0, Σ_0), σ^2~IG(a0, b0), y~N(Xβ, σ^2 I)

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
restrictedBayesLm(
  y,
  X,
  regEst = "Huber",
  scaleEst = "Huber",
  mu0,
  Sigma0,
  a0,
  b0,
  sigma2Int,
  nkeep = 10000,
  nburn = 1000,
  maxit = 400
)

Arguments

y

vector of repsonse

X

design matrix for regression. If intercept is desired, a column of 1's is needed

regEst

The estimator of β to condition on. Current options available are Huber and Tukey for Huber's and Tukey's (bisquare) estimators, respectively.

scaleEst

The estimator of σ to condition on. Currently Huber's proposal 2 is the only option available. Specified with Huber.

mu0

prior mean for beta

Sigma0

prior var-cov matrix for β

a0

prior shape parameter for σ^2

b0

prior scale parameter for σ^2

nkeep

number of iterations to keep

nburn

number of iterations to toss

maxit

maximum number of iterations for use in rlm when computing conditioning statistic during each proposal within the MCMC step for [y | rest, observed statistics]

Details

Uses Gibbs sampling to sample from the restricted posterior under the above linear regression model conditioned on estimators regEst and scaleEst for β and σ, respectively. This is just the Gibbs sampler for the full posterior (implemented in brlm::bayesLm augmented with a step to sample new data given all of the parameters and the observed conditioning statistics

Value

list with mcmc sample, mean fitted values, robust regression object from rlm, and observed conditioning statistics.


jrlewi/brlm documentation built on March 17, 2021, 1:10 a.m.