assign.convergence {ASSIGN} | R Documentation

## Check the convergence of the MCMC chain

### Description

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

### Usage

    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

    ## 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)

[Package ASSIGN version 1.30.0 Index]