This is an R implementation of the SIMULE algorithm proposed in the following paper:
"A constrained L1 minimization approach for estimating multiple Sparse Gaussian or Nonparanormal Graphical Models", accepted by Machine Learning @ URL
Please run demo(simuleDemo) to learn the basic functions provided by this package. For further details, please read the original paper @ URL or read the R-package Manual: @ URL
It depends on the following existing packages. To use them, simply
library('pcaPP')
library('lpSolve')
library('parallel')
If you don't have these packages, simply use
install.packages('packageNameFromAbove')
- install the R "simule" package through R console:
install.packages('simule')
- then load the library simule in R console, by running:
library(simule)
- Then, simply run the function
simule
on your favorite datasets For example,
simule(CovarianceMatrixList, lambda = 0.05, epsilon = 0.5, parallel = TRUE)
This function will returns a list
(a data structure in R) of graphs estimated by the SIMULE package.
-
The argument
CovarianceMatrixList
can represent alist
of data matrices directly: The i-th itemCovarianceMatrixList[[i]]
represents the i-th matrix in alist
of data matricesCovarianceMatrixList
. ** Please make sure the order of the feature variables are the same among all the data matrices inCovarianceMatrixList
.** -
If the input
CovarianceMatrixList
is Symmetric, the package automatically assumes that the data inputs belong to the following two types:
- The argument
CovarianceMatrixList
can alist
of covariance matrices. AssumingX
represents a list of data matrices, whose i-th itemX[[i]]
represents the data matrix of the i-th task.
We can use the following function to calculate the covariance matrices:
CovarianceMatrixList[[i]] = cov(X[[i]])
- The argument
CovarianceMatrixList
can represent alist
of kendall's tau correlation matrices. The kendall's tau correlation matrices can be calculated by using the following command:
cor.fk(X[[i]])
(by the 'pcaPP'
package.)
The kendall's tau correlation matrices can also be calculated through the following R functions:
cor(X[[i]], method = 'kendall')
However the above way of calculating kendall's tau correlation matrix is very slow in R.
lambda
The parameter for the sparsity level of the estimated graphs. The larger lambda
you choose, the sparser graphs you will estimate from the inputs.
epsilon
The parameter reflects the differences of sparsity level between the shared subgraph versus the context-specific subgraphs. The larger epsilon
you choose, the denser the shared subgraph is (while the context-specific subgraphs are sparser) and vice versa.
-
covType
This parameter controls SIMULE estimates the sparse Gaussian Graphical models (sGGM) or the sparse Nonparanormal Graphical Models from the input data. This parameter matters only when the input argumentCovarianceMatrixList
represents alist
of data matrices directly: WhencovType = "cov"
the package estimates sGGMs from the input. WhencovType == "kendall"
, the package estimates sNGMs from the input. -
parallel
Logic parameter for parallel implementation or not. If you have a multi-core machine, let parallel = TRUE
.