Simulate count data under the Poisson log-Normal model

generator_PLN(Sigma, covariates = NULL, n = 50, norm = FALSE)

Arguments

Sigma

Covariance matrix of the normal hidden layer of parameters

covariates

a data.frame or matrix containing data covariates. If not NULL, defines the number of simulated rows.

n

number of rows to simulate

norm

should the parameters be normalized ?

Value

  • if norm=FALSE Y: the simulated counts

  • if norm=TRUE

    • Y:simulated counts

    • U: the normalized Gaussian parameters

Examples

G<-generator_graph(p=10,graph="tree") sigma<-generator_param(G=G)$sigma generator_PLN(as.matrix(sigma))
#> [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] #> [1,] 255 28 3041 501 1 20 1 135 0 1 #> [2,] 0 0 0 0 1049 1 3879 0 1663 471 #> [3,] 0 2 0 0 23 1 82 0 58 33 #> [4,] 0 0 0 0 38 4 24972 0 1312 1565 #> [5,] 0 1 0 1 53 3 405 0 79 131 #> [6,] 1 1 0 0 709 1 216 1 271 490 #> [7,] 1699 850 2083 3603 0 49 0 1491 0 0 #> [8,] 12719 10384 4799 7587 0 99725 0 18754 0 0 #> [9,] 172 113 82 206 0 38 4 11 0 1 #> [10,] 64 25 47 25 8 10 1 142 2 2 #> [11,] 0 0 0 0 583 0 3525 0 1096 191 #> [12,] 145 33 1100 39 5 44 0 933 0 1 #> [13,] 0 1 41 0 13 33 10 14 184 82 #> [14,] 0 0 0 0 211 0 1070 0 171 137 #> [15,] 0 3 0 2 79 2 720 0 204 57 #> [16,] 2 14 12 6 14 4 17 3 0 2 #> [17,] 4653 4072 862 4030 0 58342 0 7563 0 0 #> [18,] 170 22 30 75 10 3 0 160 0 5 #> [19,] 90 50 56 7 2 22 1 35 0 3 #> [20,] 0 2 6 1 12 2 28 31 43 3 #> [21,] 2 0 2 0 752 0 52 0 308 317 #> [22,] 42 6 865 7 4 63 1 2125 5 23 #> [23,] 1 0 4 0 55 4 10 19 36 26 #> [24,] 21 29 8 2 0 97 1 36 15 3 #> [25,] 124 89 983 1082 0 1041 1 351 0 0 #> [26,] 15 46 10 91 3 3 6 10 1 1 #> [27,] 22 34 383 39 0 85 0 235 2 3 #> [28,] 1 0 0 0 14475 0 1262 1 2679 2370 #> [29,] 961 78 3979 531 8 4 0 662 0 0 #> [30,] 21 3 0 16 19 4 35 5 0 9 #> [31,] 155215 261469 62071 48698 0 505750 0 50111 0 0 #> [32,] 0 208 0 24 0 133 70 8 7 0 #> [33,] 2 33 2 1 6 2 18 2 23 6 #> [34,] 9 52 11 321 1 37 10 2 2 2 #> [35,] 0 0 1 0 461 1 207 0 594 717 #> [36,] 0 0 5 0 68 1 16 1 51 22 #> [37,] 2730 438 673 632 0 325 0 5824 0 0 #> [38,] 162 290 15 116 0 910 0 17 0 0 #> [39,] 2 2 0 0 169 1 399 0 44 17 #> [40,] 9 2 3 22 14 4 9 3 5 18 #> [41,] 0 5 4 1 6 11 14 1 13 14 #> [42,] 8 9 5 12 2 48 9 58 9 0 #> [43,] 1 1 1 1 304 2 173 0 14 112 #> [44,] 29 9 441 120 0 18 0 863 0 1 #> [45,] 1 0 3 2 704 0 12 9 49 736 #> [46,] 6 1 48 1 140 0 12 2 35 49 #> [47,] 0 1 3 2 4 4 99 0 47 16 #> [48,] 1620 160 1008 9633 1 46 0 880 0 0 #> [49,] 60 74 27 104 0 83 3 1 2 1 #> [50,] 13578 10524 17752 17903 0 3475 0 36540 0 0