hier_models: MCMC functions for the hierarchical versions of Normal Theory...

Description Usage Arguments Details

Description

MCMC functions for the hierarchical versions of Normal Theory Model, corresponding restricted version, and heavy-tailed version used in the paper.

Function to fit restricted likelihood version of hierarchical model in paper

Usage

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
fn.hier.one.rep(
  y,
  X,
  XtX,
  v1,
  v2,
  bstar,
  Beta,
  betalMat,
  Z,
  mu_rho,
  psi_rho,
  rho,
  step_logbstar,
  mu_rho_step,
  psi_rho_step,
  rho_step,
  step_Z,
  Sigma0Inv,
  nGroups,
  p,
  abc = FALSE
)

hierNormTheoryLm(
  y,
  X,
  nkeep = 10000,
  nburn = 1000,
  mu0,
  Sigma0,
  a0,
  b0,
  mu_bstr,
  psi_bstr,
  swSq = 1,
  w1,
  w2,
  a_psir,
  b_psir,
  step_logbstar,
  mu_rho_step,
  psi_rho_step,
  rho_step,
  step_Z
)

hierNormTheoryRestLm(
  y,
  X,
  regEst = "Huber",
  scaleEst = "Huber",
  nkeep = 10000,
  nburn = 1000,
  mu0,
  Sigma0,
  a0,
  b0,
  mu_bstr,
  psi_bstr,
  swSq = 1,
  w1,
  w2,
  a_psir,
  b_psir,
  maxit = 400,
  step_logbstar,
  mu_rho_step,
  psi_rho_step,
  rho_step,
  step_Z,
  abc = FALSE,
  bandwidth = NULL,
  iter_check = 1000,
  min_accept_rate = 0.1,
  bw_mult = 1.2
)

fn.compute.marginals.hierModelNormal(
  betalsamples,
  sigma2lsamples,
  yhold,
  Xhold
)

tdensity(y, mean, sigma, nu)

fn.compute.marginals.hierModelTmodel(
  betalsamples,
  sigma2lsamples,
  yhold,
  Xhold
)

fn.one.rep.tHierModel(
  y,
  X,
  v1,
  v2,
  bstar,
  Beta,
  betalMat,
  vlList,
  Z,
  mu_rho,
  psi_rho,
  rho,
  step_logbstar,
  mu_rho_step,
  psi_rho_step,
  rho_step,
  step_Z,
  Sigma0Inv
)

hier_TLm(
  y,
  X,
  nkeep = 10000,
  nburn = 1000,
  mu0,
  Sigma0,
  a0,
  b0,
  mu_bstr,
  psi_bstr,
  swSq = 1,
  w1,
  w2,
  a_psir,
  b_psir,
  nu,
  step_logbstar,
  mu_rho_step,
  psi_rho_step,
  rho_step,
  step_Z
)

Arguments

y, X

lists of group level responses and design matrices

XtX

list of X'X - for all the groups (input for efficiency)

v1, v2

parameters for beta on b_start. mu_bstr is the mean and psi_bstr (originally had a prior) is the precision of the beta prior for b^*

bstar

desc

Beta

desc

betalMat

desc

Z

desc

mu_rho

desc

psi_rho

desc

rho

desc

step_logbstar, mu_rho_step, psi_rho_step, rho_step, step_Z

tunning parameters for MH Steps

abc

new option, defaults to FALSE, if TRUE then an Approximate Bayesian Computation method version is fit

nkeep, nburn

number of MCMC iterations to keep, number for burn in.

Sigma0

is the 'variance' matrix of beta b_i~N(mu0,b^*Sigma0)

a0, b0

prior parameters for sigma2

swSq

default to 1.

w1, w2, a_psir, b_psir

parameters definining prior for rho. In detail: rho~beta(mean=mu_rho, precision=psi_rho), mu_rho~beta(w1,w2) and psi_rho~gamma(a_psir, b_psir)

regEst

Regression estimator on which to condition . Either Huber or Tukey.

scaleEst

Scale estimator on which to condition('Huber' is only option here)

bandwidth

for the abc kernel, scalar or vector of length(X) specifying the abc bandwidth for each group.

betalsamples

the array of betals: in the specific format: the 3rd dimension is the groups. columns represent samples, row represent slopes

yhold

list of holdout samples

Xhold

list of design matrices

mean

center of t distribution

sigma

scale of t distribution

nu

fixed degrees of freedom for assumed t-distribution

sigma2Int

is the vector of sigma2i initial values

mu0:

prior mean of each beta

y

data

sigma2lsamples:

columns represnt groups, rows represent samples

Details

fn.hier.one.rep is one rep for the full normal thoery model. heirNormTheoryLm uses fn.hier.one.rep for the complete MCMC of full normal thoert model. hierNormTheoryRestLm does the same for the restricted versions. The corresponding t-model versions are handedl by fn.one.rep.tHierModel and hier_TLm.

Details of the model are describted in the paper.

for abc version method - see ()


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