fit.gg {gaga}R Documentation

Fit GaGa hierarchical model

Description

Fits GaGa or MiGaGa hierarchical models, either via a fully Bayesian approach or via maximum likelihood.

Usage

fit.gg(x, groups, patterns, nclust = 1, method = "Bayes", B = 1000, priorpar, parini, trace = TRUE)

Arguments

x ExpressionSet, data frame or matrix containing the gene expression measurements used to fit the model.
groups If x is of type ExpressionSet, groups should be the name of the column in pData(x) with the groups that one wishes to compare. If x is a matrix or a data frame, groups should be a vector indicating to which group each column in x corresponds to.
patterns Matrix indicating which groups are put together under each pattern, i.e. the hypotheses to consider for each gene. Defaults to two hypotheses: null hypothesis of all groups being equal and full alternative of all groups being different.
nclust Number of clusters in the MiGaGa model. nclust corresponds to the GaGa model.
method method=='Bayes' fits a fully Bayesian model via MCMC posterior sampling. method=='EBayes' finds maximum-likelihood estimates via the expectation-maximization algorithm. For nclust>1 only Bayes is currently implemented.
B Number of MCMC iterations. Ignored if method=='EBayes'.
priorpar List with prior parameter values. It must have components a.alpha0,b.alpha0,a.nu,b.nu,a.balpha,b.balpha,a.nualpha,b.nualpha,p.probclus and p.probpat. If missing they are set to non-informative values that are usually reasonable for RMA and GCRMA normalized data.
parini List with components a0, nu, balpha, nualpha, probclus and probpat indicating the starting values for the hyper-parameters. If not specified, a method of moments estimate is used.
trace For trace==TRUE the progress of the model fitting routine is printed.

Details

The Bayesian fit uses an approximation to sample faster from the posterior distribution of the gamma shape parameters. This approximation is implemented in rcgamma.

Value

An object of class gagafit, with components

parest Hyper-parameter estimates. Only returned if method=='EBayes', for method=='Bayes' one must call the function parest after fit.gg
mcmc Object of class mcmc with posterior draws for hyper-parameters. Only returned if method=='Bayes'.
lhood For method=='Bayes' it is the log-likelihood evaluated at each MCMC iteration. For method=='EBayes' it is the log-likelihood evaluated at the maximum.
nclust Same as input argument.
patterns Same as input argument, converted to object of class gagahyp.

Author(s)

David Rossell

References

Rossell D. GaGa: a simple and flexible hierarchical model for microarray data analysis. http://rosselldavid.googlepages.com.

See Also

parest to estimate hyper-parameters and compute posterior probabilities after a GaGa or MiGaGa fit. findgenes to find differentially expressed genes. classpred to predict the group that a new sample belongs to.

Examples

#Not run
#library(EBarrays); data(gould)
#x <- log(exprs(gould)[,-1])  #exclude 1st array
#groups <- pData(gould)[-1,1]
#patterns <- rbind(rep(0,3),c(0,0,1),c(0,1,1),0:2) #4 hypothesis
#gg <- fit.gg(x,groups,patterns,method='EBayes')
#gg <- parest(gg,x,groups)
#gg
#
#gg.bay <- fit.gg(x,groups,patterns,method='Bayes',B=1000)
#plot(gg.bay$mcmc)
#gg.bay <- parest(gg.bay,x,groups,burnin=100)
#gg.bay

[Package gaga version 1.0.0 Index]