Learn R Programming

fabia (version 2.18.0)

spfabia: Factor Analysis for Bicluster Acquisition: SPARSE FABIA

Description

spfabia: C implementation of spfabia.

Usage

spfabia(X,p=13,alpha=0.01,cyc=500,spl=0,spz=0.5,non_negative=0,random=1.0,write_file=1,norm=1,scale=0.0,lap=1.0,nL=0,lL=0,bL=0,samples=0,initL=0,iter=1,quant=0.001,lowerB=0.0,upperB=1000.0,dorescale=FALSE,doini=FALSE,eps=1e-3,eps1=1e-10)

Arguments

X
the file name of the sparse matrix in sparse format.
p
number of hidden factors = number of biclusters; default = 13.
alpha
sparseness loadings (0 - 1.0); default = 0.01.
cyc
number of iterations; default = 500.
spl
sparseness prior loadings (0 - 2.0); default = 0 (Laplace).
spz
sparseness factors (0.5 - 2.0); default = 0.5 (Laplace).
non_negative
Non-negative factors and loadings if non_negative > 0; default = 0.
random
>0: random initialization of loadings in [0,random],
write_file
>0: results are written to files (L in sparse format), default = 1.
norm
data normalization: >0 (var=1), 0 (no); default = 1.
scale
loading vectors are scaled in each iteration to the given variance. 0.0 indicates non scaling; default = 0.0.
lap
minimal value of the variational parameter; default = 1.0.
nL
maximal number of biclusters at which a row element can participate; default = 0 (no limit).
lL
maximal number of row elements per bicluster; default = 0 (no limit).
bL
cycle at which the nL or lL maximum starts; default = 0 (start at the beginning).
samples
vector of samples which should be included into the analysis; default = 0 (all samples)
initL
vector of indices of the selected samples which are used to initialize L; default = 0 (random initialization).
iter
number of iterations; default = 1.
quant
qunatile of largest L values to remove in each iteration; default = 0.001.
lowerB
lower bound for filtering the inputs columns, the minimal column sum; default = 0.0.
upperB
upper bound for filtering the inputs columns, the maximal column sum; default = 1000.0.
dorescale
rescale factors Z to variance 1 and consequently also L; logical; default: FALSE.
doini
compute the information content of the biclusters and sort the biclusters according to their information content; logical, default: FALSE.
eps
lower bound for variational parameter lapla; default: 1e-3.
eps1
lower bound for divisions to avoid division by zero; default: 1e-10.

Value

  • object of the class Factorization. Containing L (loadings $L$), Z (factors $Z$), Psi (noise variance $\sigma$), lapla (variational parameter), avini (the information which the factor $z_{ij}$ contains about $x_j$ averaged over $j$) xavini (the information which the factor $z_{j}$ contains about $x_j$) ini (for each $j$ the information which the factor $z_{ij}$ contains about $x_j$).

concept

  • biclustering
  • factor analysis
  • sparse coding
  • Laplace distribution
  • EM algorithm
  • non-negative matrix factorization
  • multivariate analysis
  • latent variables

Details

Version of fabia for a sparse data matrix. The data matrix is directly scanned by the C-code and must be in sparse matrix format.

Sparse matrix format: *first line: numer of rows (the samples). *second line: number of columns (the features). *following lines: for each sample (row) three lines with

I) number of nonzero row elements

II) indices of the nonzero row elements (ATTENTION: starts with 0!!)

III) values of the nonzero row elements (ATTENTION: floats with decimal point like 1.0 !!)

Biclusters are found by sparse factor analysis where both the factors and the loadings are sparse.

Essentially the model is the sum of outer products of vectors: $$X = \sum_{i=1}^{p} \lambda_i z_i^T + U$$ where the number of summands $p$ is the number of biclusters. The matrix factorization is $$X = L Z + U$$

Here $\lambda_i$ are from $R^n$, $z_i$ from $R^l$, $L$ from $R^{n \times p}$, $Z$ from $R^{p \times l}$, and $X$, $U$ from $R^{n \times l}$. If the nonzero components of the sparse vectors are grouped together then the outer product results in a matrix with a nonzero block and zeros elsewhere.

The model selection is performed by a variational approach according to Girolami 2001 and Palmer et al. 2006.

We included a prior on the parameters and minimize a lower bound on the posterior of the parameters given the data. The update of the loadings includes an additive term which pushes the loadings toward zero (Gaussian prior leads to an multiplicative factor).

The code is implemented in C.

References

S. Hochreiter et al., FABIA: Factor Analysis for Bicluster Acquisition, Bioinformatics 26(12):1520-1527, 2010. http://bioinformatics.oxfordjournals.org/cgi/content/abstract/btq227 Mark Girolami, A Variational Method for Learning Sparse and Overcomplete Representations, Neural Computation 13(11): 2517-2532, 2001.

J. Palmer, D. Wipf, K. Kreutz-Delgado, B. Rao, Variational EM algorithms for non-Gaussian latent variable models, Advances in Neural Information Processing Systems 18, pp. 1059-1066, 2006.

See Also

fabia, fabias, fabiap, spfabia, readSamplesSpfabia, samplesPerFeature, readSpfabiaResult, fabi, fabiasp, mfsc, nmfdiv, nmfeu, nmfsc, extractPlot, extractBic, plotBicluster, Factorization, projFuncPos, projFunc, estimateMode, makeFabiaData, makeFabiaDataBlocks, makeFabiaDataPos, makeFabiaDataBlocksPos, matrixImagePlot, fabiaDemo, fabiaVersion

Examples

Run this code
#---------------
# TEST
#---------------

samples <- 20
features <- 200
sparseness <- 0.9
write(samples, file = "sparseFabiaTest.txt",ncolumns = features,append = FALSE, sep = "")
write(features, file = "sparseFabiaTest.txt",ncolumns = features,append = TRUE, sep = "")
for (i in 1:samples)
{
  ind <- which(runif(features)>sparseness)-1
  num <- length(ind)
  val <- abs(rnorm(num))
  write(num, file = "sparseFabiaTest.txt",ncolumns = features,append = TRUE, sep = "")
  write(ind, file = "sparseFabiaTest.txt",ncolumns = features,append = TRUE, sep = "")
  write(val, file = "sparseFabiaTest.txt",ncolumns = features,append = TRUE, sep = "")
}

res <- spfabia("sparseFabiaTest",p=3,alpha=0.03,cyc=50,non_negative=1,write_file=0,norm=0)

unlink("sparseFabiaTest.txt")

plot(res,dim=c(1,2))
plot(res,dim=c(1,3))
plot(res,dim=c(2,3))

Run the code above in your browser using DataLab