MakeArrays: Arrays to save MCMC posterior samples.

Description Usage Arguments

View source: R/MakeArrays_function.R

Description

Arrays to save MCMC posterior samples.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
MakeArrays(
  chains,
  Nsims,
  num_conf,
  starting_alphas,
  starting_coefs,
  starting_vars,
  omega = 50000,
  mu_priorX,
  mu_priorY,
  Sigma_priorX,
  Sigma_priorY,
  alpha_priorX,
  alpha_priorY,
  beta_priorX,
  beta_priorY
)

Arguments

chains

The number of MCMC chains.

Nsims

The number of posterior samples per chain.

num_conf

The number of potential confounders.

starting_alphas

Array of dimensions: model (exposure or outcome), chains, potential confounders. Entries 0/1 represent exclusion/inclusion of a covariate in the model. If NULL, values are set from the prior.

starting_coefs

Array with the starting values of all coefficients. Dimensions are: Exposure/Outcome model, chains, and covariate (intercept, coefficient of exposure, covariates). The coefficient of exposure should be NA for the exposure model. If NULL, values are set from the normal with mean zero and variance that of the prior divided by 50 ^ 2.

starting_vars

Array including the starting values for the residual variances. Dimensions correspond to: Exposure/Outcome model, and chains. If NULL, values are set from an inverse gamma with parameters alpha and beta set to the prior values times 200.

omega

The omega of the BAC prior on inclusion indicators.

mu_priorX

The mean of the normal prior on the coefficients of the exposure model, where the first element corresponds to the intercept, and the remaining to the coefficients of the columns in D.

mu_priorY

The mean of the normal prior on the coefficients of the outcome model, where the first element corresponds to the intercept, the second to the exposure, and the remaining to the coefficients in from of the columns in D.

Sigma_priorX

The covariance matrix of the normal prior on the coefficients of the exposure model.

Sigma_priorY

The covariance matrix of the normal prior on the coefficients of the outcome model.

alpha_priorX

The value of alpha in the inverse gamma prior for the residual variance of the exposure model.

alpha_priorY

The value of alpha in the inverse gamma prior for the residual variance of the outcome model.

beta_priorX

The value of beta in the inverse gamma prior for the residual variance of the exposure model.

beta_priorY

The value of beta in the inverse gamma prior for the residual variance of the outcome model.


gpapadog/BAC documentation built on Feb. 15, 2021, 6:37 a.m.