fitBM {PANR} | R Documentation

## Fit a three-beta mixture model to densities of functional gene associations

### Description

The function fits a three-beta mixture model to densities of functional gene associations computed from rich phenotyping screens.

### Usage

    fitBM(object, para=list(zInit=NULL, thetaInit=c(alphaNeg=2, betaNeg=4,
    alphaNULL=4, betaNULL=4, alphaPos=4, betaPos=2), gamma=NULL),
    ctrl=list(fitNULL=FALSE, tol=1e-3, maxIter=NULL), verbose=TRUE, ...)

### Arguments

`object` | an object of S4 class `BetaMixture`.
`para` | a list of initial values for parameter estimation in fitting a three-beta mixture model (see 'details').
`ctrl` | a list of control parameters for the mixture model fitting (see 'details').
`verbose` | a logical value to switch on (if `TRUE`) or off if `FALSE` detailed run-time message.
`...` | other arguments of the function `nlm`.

### Details

This function fits a beta-mixture model to functional gene associations using the Expectation-Maximization algorithm. The function allows various parameter settings to perform fitting by the original (if model='global') or stratified (if model='stratified') beta-mixture model (the model should be specified when creating a new object of `BetaMixture`).

The initial values of the beta distributions can be set by `thetaInit`, is a numeric vector including the two shape parameters for the '-' (negative), 'x' (NULL) and '+' (positive) distributions. Please note that if `ctrl$NULL` is `TRUE`, meaning that the NULL distribution has already been fitted, then `para$alphaNULL` and `para$betaNULL` are supposed to be filled in the estimated NULL parameters by the function `fitNULL`).

`zInit` is a matrix of posterior probabilities for gene associations following the three mixture components.

The hyper-parameters for the dirichlet priors for the mixture components can also be set by `para$gamma`, which is a numeric matrix with rows and columns correponding to association partitions and the three beta mixture components.

The other arguments to control the fitting algorithm are `tol` and `maxIter`, which are covergence tolerence and the maximal iterations.

Since the estimation of shape parameters of beta distributions are realized by the function `nlm` numerically, additional arguments for `nlm` are allowed by `...`.

### Value

This function will return an updated object of class `BetaMixture`.

### Author(s)

Xin Wang xw264@cam.ac.uk

### References

Xin Wang, Mauro Castro, Klaas W. Mulder and Florian Markowetz, Posterior association networks and enriched functional gene modules inferred from rich phenotypic perturbation screens, in preparation.

### See Also

`fitNULL`

### Examples

    ## Not run:
    data(Bakal2007)
    bm1<-new("BetaMixture", pheno=Bakal2007, model="global", order=1)
    bm1<-fitNULL(bm1, nPerm=10, thetaNULL=c(alphaNULL=4, betaNULL=4),
    	sumMethod="median", permMethod="all", verbose=TRUE)
    bm1<-fitBM(bm1, para=list(zInit=NULL, thetaInit=c(alphaNeg=2, betaNeg=4,
    	alphaNULL=bm1@result$fitNULL$thetaNULL[["alphaNULL"]],
    	betaNULL=bm1@result$fitNULL$thetaNULL[["betaNULL"]],
    	alphaPos=4, betaPos=2), gamma=NULL),
    	ctrl=list(fitNULL=FALSE, tol=1e-1), verbose=TRUE, gradtol=1e-3)

    ## End(Not run)

[Package PANR version 1.26.0 Index]