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 ( |
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 |
n.rho |
Optional. The number of regularization parameters. The default value is |
rho.ratio |
Optional. Determines distance between the elements of |
ncores |
Optional. The number of cores to use for the calculations. Using |
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 |
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 |
ES |
A list of estimated p by p conditional expectation corresponding to |
Z |
A list of n by p transformed data based on Gaussian copula. |
rho |
A |
loglik |
A |
data |
The |
Author(s)
Pariya Behrouzi
Maintainers: Pariya Behrouzi pariya.behrouzi@gmail.com
See Also
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 )