bayesTdistLm: MCMC algorithm for Heavy Tailed (t-distribution) Bayesian...

Description Usage Arguments Details Value

View source: R/fn_TdistLm.R

Description

Fits the heavy-tailed linear regression model y_i~N(x_i'beta,v_i), v_i~inv-chi^2(nu,sigma2) β~N(mu0,Sigma_0) sigma2~IG(a0,b0).

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
bayesTdistLm(
  y,
  X,
  mu0,
  Sigma0,
  a0,
  b0,
  parInit = NULL,
  nu,
  nkeep = 10000,
  nburn = 1000,
  rwTune = NULL
)

Arguments

y

vector of repsonse

X

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

mu0

prior mean for beta

Sigma0

prior var-cov matrix for β

a0

prior shape parameter for σ^2

b0

prior scale parameter for σ^2

parInit

vector of initial values for β, σ^2. Default is NULL in which case initial values are chosen using a robust regression using the default settings in rlm

nu

degrees of freedom for t-distribution - assumed fixed

nkeep

number of iterations to keep

nburn

number of iterations to toss

rwTune

tuning parameter for the Metropolis-Hastings random walk used to sample σ^2

Details

Uses Gibbs sampling to sample from the posterior under the above linear regression model. This model is equivalent to a linear regression with t-distributed errors.

Value

list with mcmc sample, mean fitted values, and logical acceptance vector for σ^2 proposals.


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