assign.convergence: Check the convergence of the MCMC chain

Description Usage Arguments Details Value Author(s) Examples

View source: R/assign.covergence.R

Description

The assign.convergence checks the convergence of the MCMC chain of the model parameters generated by the Gibbs sampling algorithm.

Usage

1
2
3
4
5
6
7
8
9
assign.convergence(
  test,
  burn_in = 0,
  iter = 2000,
  parameter = c("B", "S", "Delta", "beta", "kappa", "gamma", "sigma"),
  whichGene,
  whichSample,
  whichPath
)

Arguments

test

The list object returned from the assign.mcmc function. The list components are the MCMC chains of the B, S, Delta, beta, gamma, and sigma.

burn_in

The number of burn-in iterations. These iterations are discarded when computing the posterior means of the model parameters. The default is 0.

iter

The number of total iterations. The default is 2000.

parameter

A character string indicating which model parameter is to be checked for convergence. This must be one of "B", "S", "Delta", "beta", "kappa", "gamma", and "sigma".

whichGene

A numerical value indicating which gene is to be checked for convergence. The value has to be in the range between 1 and G.

whichSample

A numerical value indicating which test sample is to be checked for convergence. The value has to be in the range between 1 and N.

whichPath

A numerical value indicating which pathway is to be checked for convergence. The value has to be in the range between 1 and K.

Details

To compute the convergence of the gth gene in B, set whichGene=g, whichSample=NA, whichPath=NA.

To compute the convergence of the gth gene in the kth pathway within the signature matrix (S), set whichGene=g, whichSample=NA, whichPath=NA.

To compute the convergence of the kth pathway in the jth test sample within the pathway activation matrix (A), set whichGene=NA, whichSample=n, whichPath=k.

Value

The assign.convergence function returns the a vector of the estimated values from each Gibbs sampling iteration of the model parameter to be checked, and a trace plot of this parameter.

Author(s)

Ying Shen

Examples

1
2
3
4
5
6
7
## Not run: 
# check the 10th gene in the 1st pathway for the convergence
trace.plot <- assign.convergence(test=mcmc.chain, burn_in=0, iter=2000,
                                 parameter="S", whichGene=10, whichSample=NA,
                                 whichPath=1)

## End(Not run)

ASSIGN documentation built on Nov. 8, 2020, 8:29 p.m.