gibbs_crossgroup: Gibbs sampler for cross-group comparison

Description Usage Arguments

View source: R/mixed_effects.R

Description

A more flexible version of ltnme that allows users to change all hyperparameter specifications in the LTN-based mixed-effects model

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
gibbs_crossgroup(
  N,
  p,
  g = NULL,
  r,
  YL,
  Y,
  Xtest,
  Xadjust = NULL,
  grouplabel = NULL,
  c0 = 1,
  d0 = 0.001,
  c1 = 1,
  d1 = 0.001,
  nu = 3,
  niter,
  adjust = F,
  reff = F,
  reffcov = 1,
  SEED = 1,
  save_alpha_only = F,
  gprior_m = 1,
  pnull = 0.5,
  a1 = 3,
  a2 = 4,
  a1a2 = "hp",
  lambda_fixed
)

Arguments

N

number of samples

p

number of internal nodes

g

number of levels of the random effect. e.g., if the random effect is individual, then g is number of individuals

r

number of latent factors (unwarranted feature)

Y

N*d matrix of y(A)

Xtest

N*q1 design matrix of the covariate to test, q1 should be the number of groups-1. For the two-group problem, Xtest is a column vector.

Xadjust

N*q2 design matrix of the covariate to adjust, should include a column of 1's

c0, d0, c1, d1, nu

hyperparameters

niter

number of Gibbs iterations

SEED

random seed for initializing parameters

save_alpha_only

whether to only return posterior samples of alpha(A)

gprior_m

Var(beta2)=mN(X^TX)^-1, gprior_m=1 implies unit information prior

a1, a2

hyperparameters in prior on factor loadings (unwarranted feature)

a1a2

'hp': use Ga(2,1) hyperprior on a1,a2; 'fix': fix a1, a2

lambda_fixed

if >0, use this as the fixed value of lambda; if <=0, adopt a Gamma hyperprior on lambda

refflabel

vector of random effect labels with length g, e.g., subject ID.


MaStatLab/LTN documentation built on Feb. 4, 2022, 10:35 p.m.