Generate simulation parameters from a graph adjacency matrix

generator_param(G, signed = FALSE, v = 0.01)

Arguments

G

adjacency matrix

signed

boolean: should the graph be composed of positive and negative partial correlations ?

v

parameter controlling the noise on the precision matrix

Value

a list containing

  • sigma: the covariance matrix

  • omega: the precision matrix

  • lambda: the constant that was needed to load the diagonal of omega and ensure its positive definiteness

Examples

G<-generator_graph(p=10,graph="tree") generator_param(G=G)
#> $sigma #> [,1] [,2] [,3] [,4] [,5] [,6] #> [1,] 10.611521 10.108061 10.019818 -9.638101 -10.209141 9.829909 #> [2,] 10.108061 11.561710 9.544431 -9.180825 -10.677327 9.363532 #> [3,] 10.019818 9.544431 11.386098 -9.999951 -9.639875 10.198960 #> [4,] -9.638101 -9.180825 -9.999951 11.533275 9.272633 -10.762799 #> [5,] -10.209141 -10.677327 -9.639875 9.272633 10.784100 -9.457167 #> [6,] 9.829909 9.363532 10.198960 -10.762799 -9.457167 10.976989 #> [7,] -9.910825 -10.365331 -9.358193 9.001682 10.468984 -9.180825 #> [8,] 10.009934 10.468984 9.451775 -9.091699 -10.573674 9.272633 #> [9,] -10.120016 -9.639875 -10.499958 10.099951 9.736274 -10.300950 #> [10,] 9.542674 9.089925 9.900942 -11.419085 -9.180825 10.656237 #> [,7] [,8] [,9] [,10] #> [1,] -9.910825 10.009934 -10.120016 9.542674 #> [2,] -10.365331 10.468984 -9.639875 9.089925 #> [3,] -9.358193 9.451775 -10.499958 9.900942 #> [4,] 9.001682 -9.091699 10.099951 -11.419085 #> [5,] 10.468984 -10.573674 9.736274 -9.180825 #> [6,] -9.180825 9.272633 -10.300950 10.656237 #> [7,] 12.114342 -11.235486 9.451775 -8.912557 #> [8,] -11.235486 11.347841 -9.546293 9.001682 #> [9,] 9.451775 -9.546293 10.604958 -9.999951 #> [10,] -8.912557 9.001682 -9.999951 12.296123 #> #> $omega #> 10 x 10 sparse Matrix of class "dsCMatrix" #> #> [1,] 2.01 . . . 1.00 . . . 1.00 . #> [2,] . 1.01 . . 1.00 . . . . . #> [3,] . . 1.01 . . . . . 1.00 . #> [4,] . . . 2.01 . 1.00 . . . 1.00 #> [5,] 1.00 1.00 . . 3.01 . . 1.00 . . #> [6,] . . . 1.00 . 2.01 . . 1.00 . #> [7,] . . . . . . 1.01 1.00 . . #> [8,] . . . . 1.00 . 1.00 2.01 . . #> [9,] 1.00 . 1.00 . . 1.00 . . 3.01 . #> [10,] . . . 1.00 . . . . . 1.01 #> #> $lambda #> [1] 1 #>