nutriNetwork {nutriNetwork}R Documentation

Reconstructs conditional (in)dependence networks among variables

Description

This is the main functions of the nutriNetwork package. This function infers the direct associations between variables. In another words, it measures pairwise associations among variables while correcting the effect of remaining variables. Three methods are available to reconstruct networks, namely (i) Gibbs sampling, (ii) approximation method, and (iii) nonparanormal approach within the copula graphical model. The first two methods are able to deal with missing genotypes. The last one is computationally faster.

Usage

nutriNetwork(data, method = "gibbs", rho = NULL, n.rho = NULL, rho.ratio = NULL,
		ncores = 1, em.iter = 5, em.tol=.001, verbose = TRUE)

Arguments

data

An (n \times p) matrix or a data.frame corresponding to the data matrix, where n is sample size and p is the number of variables. Input data can contain missing values.

method

Reconstructing undirected graph using the three methods: "gibbs", "approx", and "npn". For a medium (~500) and a large number of variables we recommend to choose "gibbs" and "approx", respectively. Choosing "npn" for a very large number of variables (> 2000) is computationally efficient. The default method is "gibbs".

rho

Optional. A decreasing sequence of non-negative numbers that control the sparsity level. Leaving the input as rho = NULL, the program automatically computes a sequence of rho based on n.rho and rho.ratio. Users can also supply a decreasing sequence values to override this.

n.rho

Optional. The number of regularization parameters. The default value is 10.

rho.ratio

Optional. Determines distance between the elements of rho sequence. A small value of rho.ratio results in a large distance between the elements of rho sequence. And a large value of rho.ratio results into a small distance between elements of rho.Optional. The default value is 0.3.

ncores

Optional. The number of cores to use for the calculations. Using ncores = "all" automatically detects number of available cores and runs the computations in parallel on (available cores - 1).

em.iter

Optional. The number of EM iterations. The default value is 5.

em.tol

Optional. A criteria to stop the EM iterations. The default value is .001.

verbose

Optional. Providing a detail message for tracing output. The default value is TRUE.

Details

This function estimates a graph path . To select an optimal graph please refer to selectnet.

Value

An object with S3 class "nutriNetwork" is returned:

Theta

A list of estimated p by p precision matrices that show the conditional independence relationships patterns among measured items.

path

A list of estimated p by p adjacency matrices. This is the graph path corresponding to Theta.

ES

A list of estimated p by p conditional expectation corresponding to rho.

Z

A list of n by p transformed data based on Gaussian copula.

rho

A n.rho dimensional vector containing the penalty terms.

loglik

A n.rho dimensional vector containing the maximized log-likelihood values along the graph path.

data

The n by p input data matrix. The n by p transformed data in case of using "npn".

Author(s)

Pariya Behrouzi
Maintainers: Pariya Behrouzi pariya.behrouzi@gmail.com

See Also

selectnet

Examples

######## toy example
data(vfit)
test_dat <- vfit[1:10, c("sex", "ani.pro", "veg.pro", "B6", 
           "B12", "B9", "SPPB.total", "HandGrip"  )]
 out_test <- nutriNetwork(test_dat, method = "gibbs")  
 ########
           
  
 out <- nutriNetwork(vfit, method = "gibbs")
 sel <- selectnet(out)
  		
 cl <- c(rep("gray70", 7), rep("green3",17), rep("red3",5))
 plot(sel, vis= "parcor.network", sign.edg = TRUE, 
      vertex.color = cl, curve = TRUE, layout.tree= TRUE, 
      root.node= c(26, 29), pos.legend= "bottomleft", 
      cex.legend=1) 
 #diffeent visualization      
 plot(sel, vis= "parcor.network", sign.edg = TRUE, layout = NULL, 
     vertex.color = cl, curve = TRUE, pos.legend= "topleft", 
     cex.legend=1 )
           

[Package nutriNetwork version 0.1.2 Index]