# selectMyFam: Select a graph within a given family of graphs in Gaussian... In GGMselect: Gaussian Graphs Models Selection

## Description

Select a graph within a given family of graphs.

## Usage

 `1` ```selectMyFam(X, MyFamily, K=2.5, min.ev=10**(-8)) ```

## Arguments

 `X` `n x p` matrix where `n` is the sample size and `p` the number of variables. `n` should be greater than `3` and `p` greater than `1`. `MyFamily ` list of pxp adjacency matrices corresponding to graphs with degree less or equal to `n-3`. `K` scalar or vector with values larger than 1. Tuning parameter of the penalty function. `min.ev` minimum eigenvalue for matrix inversion.

## Details

More details are available on ../doc/Notice.pdf

## Value

 `Neighb ` array of dimension ```p x dmax x length(K)``` where `dmax` is the maximum degree of the graphs in `MyFamily`. When `K` is of length 1, matrix of dimension `p x dmax`. `Neighb[a, , k ]` contains the indices of the nodes connected to node `a` for `K[k]`. `crit.min ` vector of dimension `length(K)`. The minimal values of the selection criterion for each value of `K`. `ind.min` vector of dimension `length(K)`. Indices of the families for which the criterion is minimum. `G` array of dimension `p x p x length(K)` or, when `length(K)` equals 1, matrix of dimension `p x p`. `G[,,k]` gives the adjacency matrix for `K[k]`.

## Note

Adjacency matrices can be generated from lists of connected nodes by using the function `convertGraph`

## Author(s)

Bouvier A, Giraud C, Huet S, Verzelen N.

## References

Please use `citation("GGMselect")`.

`selectFast`, `selectQE`, `simulateGraph`, `penalty`, `convertGraph`
 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23``` ```p=30 n=30 # generate graph eta=0.11 Gr <- simulateGraph(p,eta) # generate data X <- rmvnorm(n, mean=rep(0,p), sigma=Gr\$C) # generate a family of candidate graphs with glasso library("glasso") MyFamily <- NULL for (j in 1:3){ MyFamily[[j]] <- abs(sign(glasso(cov(X),rho=j/5)\$wi)) diag(MyFamily[[j]]) <- 0 } # select a graph within MyFamily GMF <- selectMyFam(X,MyFamily) # plot the result library(network) par(mfrow=c(1,2)) gV <- network(Gr\$G) plot(gV,jitter=TRUE, usearrows = FALSE, label=1:p,displaylabels=TRUE) gMyFam <- network(GMF\$G) plot(gMyFam, jitter=TRUE, usearrows = FALSE, label=1:p,displaylabels=TRUE) ```