assign.mcmc {ASSIGN} | R Documentation

## The Gibbs sampling algorithm to approximate the joint distribution of the model parameters

### Description

The assign.mcmc function uses a Bayesian sparse factor analysis model to estimate the adaptive baseline/background, adaptive pathway signature, and pathway activation status of individual test (disease) samples.

### Usage

    assign.mcmc(
      Y,
      Bg,
      X,
      Delta_prior_p,
      iter = 2000,
      adaptive_B = TRUE,
      adaptive_S = FALSE,
      mixture_beta = TRUE,
      sigma_sZero = 0.01,
      sigma_sNonZero = 1,
      p_beta = 0.01,
      sigma_bZero = 0.01,
      sigma_bNonZero = 1,
      alpha_tau = 1,
      beta_tau = 0.01,
      Bg_zeroPrior = TRUE,
      S_zeroPrior = FALSE,
      ECM = FALSE,
      progress_bar = TRUE
    )

### Arguments

`Y` | The G x J matrix of genomic measures (i.g., gene expression) of test samples. Y is the testData_sub variable returned from the data.process function. Genes/probes present in at least one pathway signature are retained.
`Bg` | The G x 1 vector of genomic measures of the baseline/background (B). Bg is the B_vector variable returned from the data.process function. Bg is the starting value of baseline/background level in the MCMC chain.
`X` | The G x K matrix of genomic measures of the signature. X is the S_matrix variable returned from the data.process function. X is the starting value of pathway signatures in the MCMC chain.
`Delta_prior_p` | The G x K matrix of prior probability of a gene being "significant" in its associated pathway. Delta_prior_p is the Pi_matrix variable returned from the data.process function.
`iter` | The number of iterations in the MCMC. The default is 2000.
`adaptive_B` | Logicals. If TRUE, the model adapts the baseline/background (B) of genomic measures for the test samples. The default is TRUE.
`adaptive_S` | Logicals. If TRUE, the model adapts the signatures (S) of genomic measures for the test samples. The default is FALSE.
`mixture_beta` | Logicals. If TRUE, elements of the pathway activation matrix are modeled by a spike-and-slab mixture distribution. The default is TRUE.
`sigma_sZero` | Each element of the signature matrix (S) is modeled by a spike-and-slab mixture distribution. Sigma_sZero is the variance of the spike normal distribution. The default is 0.01.
`sigma_sNonZero` | Each element of the signature matrix (S) is modeled by a spike-and-slab mixture distribution. Sigma_sNonZero is the variance of the slab normal distribution. The default is 1.
`p_beta` | p_beta is the prior probability of a pathway being activated in individual test samples. The default is 0.01.
`sigma_bZero` | Each element of the pathway activation matrix (A) is modeled by a spike-and-slab mixture distribution. sigma_bZero is the variance of the spike normal distribution. The default is 0.01.
`sigma_bNonZero` | Each element of the pathway activation matrix (A) is modeled by a spike-and-slab mixture distribution. sigma_bNonZero is the variance of the slab normal distribution. The default is 1.
`alpha_tau` | The shape parameter of the precision (inverse of the variance) of a gene. The default is 1.
`beta_tau` | The rate parameter of the precision (inverse of the variance) of a gene. The default is 0.01.
`Bg_zeroPrior` | Logicals. If TRUE, the prior distribution of baseline/background level follows a normal distribution with mean zero. The default is TRUE.
`S_zeroPrior` | Logicals. If TRUE, the prior distribution of signature follows a normal distribution with mean zero. The default is TRUE.
`ECM` | Logicals. If TRUE, ECM algorithm, rather than Gibbs sampling, is applied to approximate the model parameters. The default is FALSE.
`progress_bar` | Display a progress bar for MCMC. Default is TRUE.

### Details

The assign.mcmc function can be set as following major modes. The combination of logical values of adaptive_B, adaptive_S and mixture_beta can form different modes.

Mode A: adaptive_B = FALSE, adaptive_S = FALSE, mixture_beta = FALSE. This is a regression mode without adaptation of baseline/background, signature, and no shrinkage of the pathway activation level.

Mode B: adaptive_B = TRUE, adaptive_S = FALSE, mixture_beta = FALSE. This is a regression mode with adaptation of baseline/background, but without signature, and with no shrinkage of the pathway activation level.

Mode C: adaptive_B = TRUE, adaptive_S = FALSE, mixture_beta = TRUE. This is a regression mode with adaptation of baseline/background, but without signature, and with shrinkage of the pathway activation level when it is not significantly activated.

Mode D: adaptive_B = TRUE, adaptive_S = TRUE, mixture_beta = TRUE. This is a Bayesian factor analysis mode with adaptation of baseline/background, adaptation signature, and with shrinkage of the pathway activation level.

### Value

`beta_mcmc` | The iter x K x J array of the pathway activation level estimated in every iteration of MCMC.
`tau2_mcmc` | The iter x G matrix of the precision of genes estimated in every iteration of MCMC
`gamma_mcmc` | The iter x K x J array of probability of pathway being activated estimated in every iteration of MCMC.
`kappa_mcmc` | The iter x K x J array of pathway activation level (adjusted beta scaling between 0 and 1) estimated in every iteration of MCMC.)
`S_mcmc` | The iter x G x K array of signature estimated in every iteration of MCMC.
`Delta_mcmc` | The iter x G x K array of binary indicator of a gene being significant estimated in every iteration of MCMC.

### Author(s)

Ying Shen

### Examples

    mcmc.chain <- assign.mcmc(Y=processed.data$testData_sub,
                              Bg = processed.data$B_vector,
                              X=processed.data$S_matrix,
                              Delta_prior_p = processed.data$Pi_matrix,
                              iter = 20, adaptive_B=TRUE, adaptive_S=FALSE,
                              mixture_beta=TRUE)

[Package ASSIGN version 1.28.1 Index]