O pacote ecoCopula permite visualizar dados discretos multivariados com modelos gráficos e ordenação. O pacote foi projetado principalmente para dados de abundância multivariada em ecologia, porém pode ser aplicado a quaisquer dados discretos multivariados.

As duas funções principais são:

  1. Ordenação de cópula ( cord) para visualizar como amostras (sítios) e variáveis estão localizadas ao longo de diversas variáveis latentes (gradiente ambiental não observado).\
  2. Modelos gráficos de cópula (cgr) para traçar um gráfico que distingue entre associações diretas e indiretas entre variáveis.

crg: Ajustando lasso gráfico de cópula gaussiana a dados de coocorrência

Valor: Três objetos são retornados; best_graph é uma lista com parâmetros para o ‘melhor’ modelo gráfico, escolhido pelo método selecionado; all_graphs é uma lista com verossimilhança, BIC e AIC para todos os modelos ao longo do caminho de lambda; obj é o objeto de entrada.

Detalhes: cgr é usado para ajustar um modelo gráfico de cópula gaussiana a dados discretos multivariados, como dados de coocorrência (multi espécies) em ecologia. O modelo é estimado usando amostragem de importância com conjuntos n.samp de quantis aleatorizados ou resíduos “Dunn-Smyth” (Dunn & Smyth 1996), e o pacote glasso para ajustar modelos gráficos gaussianos.

Spider data

stackedsdm ajusta uma regressão separada para cada resposta de espécie, ou seja, coluna de y. Diferentes famílias podem ser permitidas para cada espécie, o que permite tipos de respostas mistas.

data(spider)
X <- spider$x
abund <- spider$abund
myfamily <- "negative.binomial"
fit0 <- stackedsdm(abund, formula_X = ~. -bare.sand, data = X, family = myfamily, ncores = 2);fit0
## $call
## stackedsdm(y = abund, formula_X = ~. - bare.sand, data = X, family = myfamily, 
##     ncores = 2)
## 
## $fits
## $fits[[1]]
## $fits[[1]]$params
## $fits[[1]]$params$coefficients
##                     resp
## (Intercept)   -2.6144490
## soil.dry      -0.8139362
## fallen.leaves -0.3623206
## moss           0.1457828
## herb.layer     0.7919684
## reflection     0.8805509
## 
## $fits[[1]]$params$dispparam
##      resp 
## 0.1364675 
## 
## 
## $fits[[1]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.136  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp  
## 2*log-likelihood:   -99.36
## Residual Deviance:   22.67
## AIC:                113.36
## 
## 
## $fits[[2]]
## $fits[[2]]$params
## $fits[[2]]$params$coefficients
##                      resp
## (Intercept)   -6.08221350
## soil.dry       1.48307414
## fallen.leaves  0.23767728
## moss          -0.08640453
## herb.layer     0.62728217
## reflection     0.46986485
## 
## $fits[[2]]$params$dispparam
##     resp 
## 1.014417 
## 
## 
## $fits[[2]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 1.014  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -123.92
## Residual Deviance:    27.16
## AIC:                 137.92
## 
## 
## $fits[[3]]
## $fits[[3]]$params
## $fits[[3]]$params$coefficients
##                       resp
## (Intercept)    3.833094767
## soil.dry      -1.963033078
## fallen.leaves -0.311219557
## moss          -0.226492084
## herb.layer    -0.004973723
## reflection     0.529356681
## 
## $fits[[3]]$params$dispparam
##      resp 
## 0.7209418 
## 
## 
## $fits[[3]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.721  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp  
## 2*log-likelihood:   -78.74
## Residual Deviance:   19.18
## AIC:                 92.74
## 
## 
## $fits[[4]]
## $fits[[4]]$params
## $fits[[4]]$params$coefficients
##                      resp
## (Intercept)   -20.4761287
## soil.dry        5.5878544
## fallen.leaves  -0.7361578
## moss            0.7390316
## herb.layer      1.0022836
## reflection     -0.2612570
## 
## $fits[[4]]$params$dispparam
##      resp 
## 0.8670633 
## 
## 
## $fits[[4]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.867  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp 
## 2*log-likelihood:   -39.7
## Residual Deviance:   10.7
## AIC:                 53.7
## 
## 
## $fits[[5]]
## $fits[[5]]$params
## $fits[[5]]$params$coefficients
##                       resp
## (Intercept)   -14.64523768
## soil.dry       -1.99686089
## fallen.leaves  -0.96498875
## moss            0.43852083
## herb.layer     -0.03205927
## reflection      4.28634513
## 
## $fits[[5]]$params$dispparam
##        resp 
## 0.005611513 
## 
## 
## $fits[[5]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.006  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -26.602
## Residual Deviance:    6.045
## AIC:                 40.602
## 
## 
## $fits[[6]]
## $fits[[6]]$params
## $fits[[6]]$params$coefficients
##                      resp
## (Intercept)   -16.3511876
## soil.dry       -0.1037164
## fallen.leaves   0.8426832
## moss            0.2535792
## herb.layer      4.2081646
## reflection     -0.2789977
## 
## $fits[[6]]$params$dispparam
##      resp 
## 0.1917023 
## 
## 
## $fits[[6]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.192  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp  
## 2*log-likelihood:   -76.69
## Residual Deviance:   18.34
## AIC:                 90.69
## 
## 
## $fits[[7]]
## $fits[[7]]$params
## $fits[[7]]$params$coefficients
##                     resp
## (Intercept)    5.0939789
## soil.dry      -1.6844420
## fallen.leaves  0.4285403
## moss          -0.3362819
## herb.layer     0.5681939
## reflection    -1.1738041
## 
## $fits[[7]]$params$dispparam
##      resp 
## 0.2499474 
## 
## 
## $fits[[7]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
## resp  
## 0.25  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp  
## 2*log-likelihood:   -92.34
## Residual Deviance:   27.09
## AIC:                106.34
## 
## 
## $fits[[8]]
## $fits[[8]]$params
## $fits[[8]]$params$coefficients
##                     resp
## (Intercept)   -5.6455463
## soil.dry       1.2002696
## fallen.leaves -0.3664443
## moss           0.7593639
## herb.layer     0.8329403
## reflection     0.1681142
## 
## $fits[[8]]$params$dispparam
##      resp 
## 0.5784331 
## 
## 
## $fits[[8]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.578  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -155.71
## Residual Deviance:    27.98
## AIC:                 169.71
## 
## 
## $fits[[9]]
## $fits[[9]]$params
## $fits[[9]]$params$coefficients
##                     resp
## (Intercept)   -5.3342006
## soil.dry       2.2313336
## fallen.leaves -0.6775421
## moss          -0.1997778
## herb.layer     0.9371083
## reflection    -0.4896571
## 
## $fits[[9]]$params$dispparam
##      resp 
## 0.8870737 
## 
## 
## $fits[[9]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.887  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp  
## 2*log-likelihood:   -126.5
## Residual Deviance:    26.5
## AIC:                 140.5
## 
## 
## $fits[[10]]
## $fits[[10]]$params
## $fits[[10]]$params$coefficients
##                       resp
## (Intercept)   -17.65397856
## soil.dry        2.51677974
## fallen.leaves  -0.07824795
## moss            0.60379080
## herb.layer      3.08705308
## reflection     -0.17243471
## 
## $fits[[10]]$params$dispparam
##      resp 
## 0.2605146 
## 
## 
## $fits[[10]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.261  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -118.03
## Residual Deviance:    25.54
## AIC:                 132.03
## 
## 
## $fits[[11]]
## $fits[[11]]$params
## $fits[[11]]$params$coefficients
##                     resp
## (Intercept)   -0.8033398
## soil.dry       1.3933952
## fallen.leaves -0.1906417
## moss          -0.2255547
## herb.layer     0.4301938
## reflection    -0.1960337
## 
## $fits[[11]]$params$dispparam
##      resp 
## 0.3413161 
## 
## 
## $fits[[11]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.341  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -208.06
## Residual Deviance:    30.89
## AIC:                 222.06
## 
## 
## $fits[[12]]
## $fits[[12]]$params
## $fits[[12]]$params$coefficients
##                      resp
## (Intercept)   -3.12403433
## soil.dry       1.75106244
## fallen.leaves -0.46304204
## moss          -0.06552062
## herb.layer     0.65999721
## reflection    -0.80362555
## 
## $fits[[12]]$params$dispparam
##      resp 
## 0.6262394 
## 
## 
## $fits[[12]]$fit
## 
## Call:  manyglm(formula = formula_X, family = "negative.binomial", data = data.frame(resp = y[,      j], data)) 
## [1] "negative.binomial"
## 
## Nuisance Parameter(s) phi estimated by the PHI method.
##  resp  
## 0.626  
## 
## Degrees of Freedom: 27 Total (i.e. Null); 22 Residual
## 
##                     resp   
## 2*log-likelihood:   -118.39
## Residual Deviance:    25.48
## AIC:                 132.39
## 
## 
## 
## $y
##         Alopacce Alopcune Alopfabr Arctlute Arctperi Auloalbi Pardlugu Pardmont
## units1        25       10        0        0        0        4        0       60
## units2         0        2        0        0        0       30        1        1
## units3        15       20        2        2        0        9        1       29
## units4         2        6        0        1        0       24        1        7
## units5         1       20        0        2        0        9        1        2
## units6         0        6        0        6        0        6        0       11
## units7         2        7        0       12        0       16        1       30
## units8         0       11        0        0        0        7       55        2
## units9         1        1        0        0        0        0        0       26
## units10        3        0        1        0        0        0        0       22
## units11       15        1        2        0        0        1        0       95
## units12       16       13        0        0        0        0        0       96
## units13        3       43        1        2        0       18        1       24
## units14        0        2        0        1        0        4        3       14
## units15        0        0        0        0        0        0        6        0
## units16        0        3        0        0        0        0        6        0
## units17        0        0        0        0        0        0        2        0
## units18        0        1        0        0        0        0        5        0
## units19        0        1        0        0        0        0       12        0
## units20        0        2        0        0        0        0       13        0
## units21        0        1        0        0        0        0       16        1
## units22        7        0       16        0        4        0        0        2
## units23       17        0       15        0        7        0        2        6
## units24       11        0       20        0        5        0        0        3
## units25        9        1        9        0        0        2        1       11
## units26        3        0        6        0       18        0        0        0
## units27       29        0       11        0        4        0        0        1
## units28       15        0       14        0        1        0        0        6
##         Pardnigr Pardpull Trocterr Zoraspin
## units1        12       45       57        4
## units2        15       37       65        9
## units3        18       45       66        1
## units4        29       94       86       25
## units5       135       76       91       17
## units6        27       24       63       34
## units7        89      105      118       16
## units8         2        1       30        3
## units9         1        1        2        0
## units10        0        0        1        0
## units11        0        1        4        0
## units12        1        8       13        0
## units13       53       72       97       22
## units14       15       72       94       32
## units15        0        0       25        3
## units16        2        0       28        4
## units17        0        0       23        2
## units18        0        0       25        0
## units19        1        0       22        3
## units20        0        0       22        2
## units21        0        1       18        2
## units22        0        0        1        0
## units23        0        0        1        0
## units24        0        0        0        0
## units25        6        0       16        6
## units26        0        0        1        0
## units27        0        0        0        0
## units28        0        0        2        0
## 
## $formula_X
## resp ~ soil.dry + fallen.leaves + moss + herb.layer + reflection
## 
## $data
##    soil.dry bare.sand fallen.leaves   moss herb.layer reflection
## 1    2.3321    0.0000        0.0000 3.0445     4.4543     3.9120
## 2    3.0493    0.0000        1.7918 1.0986     4.5643     1.6094
## 3    2.5572    0.0000        0.0000 2.3979     4.6052     3.6889
## 4    2.6741    0.0000        0.0000 2.3979     4.6151     2.9957
## 5    3.0155    0.0000        0.0000 0.0000     4.6151     2.3026
## 6    3.3810    2.3979        3.4340 2.3979     3.4340     0.6931
## 7    3.1781    0.0000        0.0000 0.6931     4.6151     2.3026
## 8    2.6247    0.0000        4.2627 1.0986     3.4340     0.6931
## 9    2.4849    0.0000        0.0000 4.3307     3.2581     3.4012
## 10   2.1972    3.9318        0.0000 3.4340     3.0445     3.6889
## 11   2.2192    0.0000        0.0000 4.1109     3.7136     3.6889
## 12   2.2925    0.0000        0.0000 3.8286     4.0254     3.6889
## 13   3.5175    1.7918        1.7918 0.6931     4.5109     3.4012
## 14   3.0865    0.0000        0.0000 1.7918     4.5643     1.0986
## 15   3.2696    0.0000        4.3944 0.6931     3.0445     0.6931
## 16   3.0301    0.0000        4.6052 0.6931     0.6931     0.0000
## 17   3.3322    0.0000        4.4543 0.6931     3.0445     1.0986
## 18   3.1224    0.0000        4.3944 0.0000     3.0445     1.0986
## 19   2.9232    0.0000        4.5109 1.6094     1.6094     0.0000
## 20   3.1091    0.0000        4.5951 0.6931     0.6931     0.0000
## 21   2.9755    0.0000        4.5643 0.6931     1.7918     0.0000
## 22   1.2528    3.2581        0.0000 4.3307     0.6931     3.9120
## 23   1.1939    3.0445        0.0000 4.0254     3.2581     4.0943
## 24   1.6487    3.2581        0.0000 4.0254     3.0445     4.0073
## 25   1.8245    3.5835        0.0000 1.0986     4.1109     2.3026
## 26   0.9933    4.5109        0.0000 1.7918     1.7918     4.3820
## 27   0.9555    2.3979        0.0000 3.8286     3.4340     3.6889
## 28   0.9555    3.4340        0.0000 3.7136     3.4340     3.6889
## 
## $family
##  [1] "negative.binomial" "negative.binomial" "negative.binomial"
##  [4] "negative.binomial" "negative.binomial" "negative.binomial"
##  [7] "negative.binomial" "negative.binomial" "negative.binomial"
## [10] "negative.binomial" "negative.binomial" "negative.binomial"
## 
## $trial_size
## [1] 1
## 
## $linear_predictor
##             [,1]         [,2]       [,3]        [,4]        [,5]        [,6]
##  [1,]  2.9035862  1.745619389  0.6142391  -1.7522773  -1.3416598   1.8319458
##  [2,] -0.5534935  2.390375108 -2.1300043   0.2100244 -13.8155106   3.8793586
##  [3,]  2.5491632  2.125158575  0.1999601  -0.7627781  -3.0358221   2.3418914
##  [4,]  1.8514566  1.979029718 -0.3965178   0.0814681  -6.2408669   2.5648290
##  [5,]  0.6136963  2.366877314 -0.8904890   0.3981151 -10.9449901   2.1147359
##  [6,] -2.9310740  2.020804829 -4.0659360   0.9213298 -13.8155106   1.0574429
##  [7,]  0.5823924  2.548138192 -1.3666599   1.8189230 -10.9657409   2.2736274
##  [8,] -2.8051648  1.208384422 -2.5449206  -4.8750422 -13.8155106   1.5047396
##  [9,]  1.5695847  0.870737719 -0.2414723  -1.0133923  -3.2338704  -2.7490428
## [10,]  1.7572006  0.522728876  0.6797460  -3.5729591  -1.8125658  -3.9257197
## [11,]  2.3678805  0.916583781  0.4799189  -2.2791478  -1.5811128  -0.9406708
## [12,]  2.5140003  1.245271693  0.3984165  -1.7656747  -1.8612733   0.2922471
## [13,]  0.5417865  3.928194434 -2.0084870   2.0049383  -8.6602230   3.0033481
## [14,] -0.2832947  1.719772728 -2.0727857   2.3826869 -13.8155106   2.6838738
## [15,] -3.7453765  1.986831664 -3.7580885  -2.0584536 -13.8155106  -0.1930722
## [16,] -6.0993604 -0.118916840 -3.7087490  -5.7276192 -13.8155106  -9.6922993
## [17,] -3.4609686  2.284439173 -3.6849622  -1.8586895 -13.8155106  -0.2622217
## [18,] -3.3695438  2.018940327 -3.0974942  -3.4991483 -13.8155106  -0.4666945
## [19,] -5.1189223  0.195735749 -3.6816449  -4.6599741 -13.8155106  -5.6723812
## [20,] -6.1600019 -0.004154524 -3.8606853  -5.2787435 -13.8155106  -9.7090040
## [21,] -5.1699648  0.479581228 -3.5943032  -4.9013983 -13.8155106  -5.0975917
## [22,]  0.9908218 -2.325529721  2.4603337 -10.6024953   1.4981590 -13.5577080
## [23,]  3.1861786 -0.691868363  2.7288485  -8.6340160   2.1810624  -2.8859361
## [24,]  2.5702280 -0.192231958  1.7910694  -6.2840182   0.9068259  -3.8076974
## [25,]  1.3439409  0.189336332  1.2011669  -5.9504709  -8.0688056   0.3950877
## [26,]  2.1159048 -1.580983608  3.7881146 -12.9504526   2.8823426  -9.6822245
## [27,]  3.1338628 -1.108573106  3.0259332  -9.8293866   0.8274896  -2.0577926
## [28,]  3.1170978 -1.098636585  3.0519798  -9.9143753   0.7770597  -2.0869543
##              [,7]        [,8]        [,9]        [,10]       [,11]       [,12]
##  [1,] -1.91913419  3.83331448  1.51989181   3.12974052  2.90882446  0.55618328
##  [2,]  1.06031614  2.26443044  3.52549851   4.35627776  4.50419098  3.03289100
##  [3,] -1.73324604  3.70067489  2.40199351   3.81016300  3.47697275  1.27159551
##  [4,] -1.11085120  3.73269572  3.01154410   4.25446812  3.78001010  2.03990191
##  [5,] -0.06598566  2.20506916  4.59175002   3.78538126  4.93244379  3.35181939
##  [6,]  1.20173168  1.95191105  2.28286026   2.51580603  4.05362261  2.75854708
##  [7,] -0.57295292  2.92654808  4.81609886   4.61309705  5.00267787  3.59112980
##  [8,]  3.26773759 -0.24616663  0.29339484  -0.23698396  3.13487629  1.13562656
##  [9,] -2.68913710  3.91117352  0.73303325   0.68624695  2.41716289  0.36047627
## [10,] -2.36204880  2.75538481 -0.07082135  -1.28825380  2.07024972 -0.45673053
## [11,] -2.24655724  3.85312450  0.47005755   1.24136856  2.23606913 -0.02095393
## [12,] -2.09793160  3.98644663  0.98220195   2.21794153  2.53601353  0.33168254
## [13,] -1.72554097  2.77522268  3.72380961   4.81597971  4.87381555  2.40412694
## [14,]  0.59626488  3.40619356  4.93415487   5.09673408  4.84139661  4.29278228
## [15,]  2.15293053 -0.15272580  1.35915585  -0.07146230  3.93227125  1.97340379
## [16,]  2.12420322 -2.59253263 -1.18220955  -7.83010783  2.68267896  0.46149051
## [17,]  1.59717647 -0.03136861  1.25969660   0.01147878  3.92858669  1.72941393
## [18,]  2.15797983 -0.78755025  0.97061358  -0.93034196  3.80400380  1.43518959
## [19,]  2.47635964 -1.22725744 -0.68123098  -4.70985256  2.73921337  0.86268569
## [20,]  1.98680405 -2.49401025 -0.99909101  -7.63049193  2.79468266  0.60450117
## [21,]  2.82292106 -1.72792826 -0.24672800  -4.57257845  3.08705081  1.10995985
## [22,] -2.67073255  0.38170227 -4.66999259 -10.42104817 -0.50322049 -3.90039254
## [23,] -1.22541926  2.24631172 -2.42600766  -2.86676753  0.55128066 -2.43713477
## [24,] -2.01074873  2.59965232 -1.56876329  -2.36652882  1.11016230 -1.71181155
## [25,]  1.28426206  1.18981676  1.24226572  -0.10527100  2.80821202  0.86155248
## [26,] -1.30724701 -0.86355138 -3.94234569  -9.29641607  0.08837248 -3.84100801
## [27,] -0.18186254  1.88908534 -2.55529698  -2.97267618  0.41862757 -2.39981029
## [28,] -0.14319012  1.80175850 -2.53232253  -3.04211212  0.44456637 -2.39227542
## 
## $fitted
##             Alopacce    Alopcune    Alopfabr     Arctlute     Arctperi
## units1  18.239439075  5.72944913  1.84824965 1.733787e-01 2.614114e-01
## units2   0.574937738 10.91758845  0.11883678 1.233708e+00 1.000000e-06
## units3  12.796390651  8.37422532  1.22135400 4.663690e-01 4.803516e-02
## units4   6.369090246  7.23571889  0.67265832 1.084879e+00 1.948166e-03
## units5   1.847246864 10.66403979  0.41045498 1.489015e+00 1.764620e-05
## units6   0.053339718  7.54439444  0.01714693 2.512629e+00 1.000000e-06
## units7   1.790316488 12.78328159  0.25495713 6.165215e+00 1.728380e-05
## units8   0.060496800  3.34807121  0.07847928 7.634772e-03 1.000000e-06
## units9   4.804652178  2.38867237  0.78547053 3.629855e-01 3.940469e-02
## units10  5.796189060  1.68662396  1.97337649 2.807266e-02 1.632348e-01
## units11 10.674743518  2.50073273  1.61594333 1.023714e-01 2.057460e-01
## units12 12.354251711  3.47387850  1.48946423 1.710713e-01 1.554745e-01
## units13  1.719075301 50.81514469  0.13419156 7.425636e+00 1.733456e-04
## units14  0.753297790  5.58325940  0.12583476 1.083397e+01 1.000000e-06
## units15  0.023626731  7.29239238  0.02332829 1.276512e-01 1.000000e-06
## units16  0.002244303  0.88788163  0.02450816 3.254817e-03 1.000000e-06
## units17  0.031399335  9.82017726  0.02509812 1.558768e-01 1.000000e-06
## units18  0.034405328  7.53034101  0.04516223 3.022311e-02 1.000000e-06
## units19  0.005982467  1.21620548  0.02518152 9.466707e-03 1.000000e-06
## units20  0.002112249  0.99585409  0.02105357 5.098833e-03 1.000000e-06
## units21  0.005684769  1.61539778  0.02747983 7.436178e-03 1.000000e-06
## units22  2.693446952  0.09773166 11.70871816 2.485391e-05 4.473446e+00
## units23 24.195787923  0.50063982 15.31524154 1.779486e-04 8.855710e+00
## units24 13.068803874  0.82511545  5.99586115 1.865888e-03 2.476450e+00
## units25  3.834123624  1.20844732  3.32399352 2.604614e-03 3.131571e-04
## units26  8.297089369  0.20577260 44.17303581 2.375144e-06 1.785605e+01
## units27 22.962508395  0.33002954 20.61323125 5.384577e-05 2.287569e+00
## units28 22.580750360  0.33332523 21.15718899 4.945857e-05 2.175068e+00
##             Auloalbi    Pardlugu    Pardmont     Pardnigr     Pardpull
## units1  6.246029e+00  0.14673395 46.21546509 4.571731e+00 2.286804e+01
## units2  4.839317e+01  2.88728364  9.62564065 3.397070e+01 7.796638e+01
## units3  1.040089e+01  0.17670987 40.47461115 1.104517e+01 4.515780e+01
## units4  1.299844e+01  0.32927856 41.79161499 2.031875e+01 7.041935e+01
## units5  8.287397e+00  0.93614429  9.07087888 9.866695e+01 4.405246e+01
## units6  2.879000e+00  3.32587128  7.04213262 9.804684e+00 1.237658e+01
## units7  9.714575e+00  0.56385795 18.66309570 1.234824e+02 1.007958e+02
## units8  4.502981e+00 26.25187948  0.78179195 1.340972e+00 7.890039e-01
## units9  6.398908e-02  0.06793954 49.95754379 2.081384e+00 1.986247e+00
## units10 1.972793e-02  0.09422697 15.72709170 9.316283e-01 2.757519e-01
## units11 3.903659e-01  0.10576271 47.14012274 1.600086e+00 3.460346e+00
## units12 1.339434e+00  0.12270998 53.86315317 2.670330e+00 9.188397e+00
## units13 2.015290e+01  0.17807669 16.04219884 4.142190e+01 1.234677e+02
## units14 1.464170e+01  1.81532567 30.15026027 1.389557e+02 1.634871e+02
## units15 8.244225e-01  8.61005347  0.85836505 3.892906e+00 9.310314e-01
## units16 6.175724e-05  8.36622883  0.07483028 3.066005e-01 3.975826e-04
## units17 7.693405e-01  4.93906712  0.96911828 3.524352e+00 1.011545e+00
## units18 6.270717e-01  8.65363817  0.45495797 2.639564e+00 3.944188e-01
## units19 3.439665e-03 11.89787290  0.29309531 5.059937e-01 9.006105e-03
## units20 6.073417e-05  7.29219102  0.08257814 3.682140e-01 4.854220e-04
## units21 6.111447e-03 16.82592849  0.17765208 7.813532e-01 1.033129e-02
## units22 1.294083e-06  0.06920151  1.46477591 9.372339e-03 2.979863e-05
## units23 5.580253e-02  0.29363456  9.45280688 8.838901e-02 5.688250e-02
## units24 2.219924e-02  0.13388839 13.45905784 2.083026e-01 9.380578e-02
## units25 1.484514e+00  3.61200153  3.28647894 3.463452e+00 9.000806e-01
## units26 6.238258e-05  0.27056389  0.42166194 1.940265e-02 9.175248e-05
## units27 1.277356e-01  0.83371593  6.61331698 7.766916e-02 5.116620e-02
## units28 1.240644e-01  0.86658930  6.06029510 7.947422e-02 4.773396e-02
##            Trocterr    Zoraspin
## units1   18.3352321  1.74400341
## units2   90.3951831 20.75715483
## units3   32.3616070  3.56653846
## units4   43.8164845  7.68985486
## units5  138.7180969 28.55463853
## units6   57.6057630 15.77690371
## units7  148.8111236 36.27503647
## units8   22.9857922  3.11312349
## units9   11.2139988  1.43401223
## units10   7.9268024  0.63335099
## units11   9.3564798  0.97926407
## units12  12.6292245  1.39331046
## units13 130.8191121 11.06876236
## units14 126.6461033 73.16976425
## units15  51.0227314  7.19512558
## units16  14.6242186  1.58643682
## units17  50.8350811  5.63734903
## units18  44.8805177  4.20044127
## units19  15.4748074  2.36951595
## units20  16.3574371  1.83033895
## units21  21.9123589  3.03423657
## units22   0.6045805  0.02023397
## units23   1.7354742  0.08741095
## units24   3.0348509  0.18053844
## units25  16.5802466  2.36683229
## units26   1.0923949  0.02147195
## units27   1.5198742  0.09073516
## units28   1.5598137  0.09142142
## 
## attr(,"class")
## [1] "stackedsdm"

summary.cgr Função de resumo para objeto cgr

abund <- spider$abund[,1:12]
spider_mod <- stackedsdm(abund,~1, data = spider$x, ncores=2)
spid_graph=cgr(spider_mod)
summary(spid_graph)
## 
## Call:
## stackedsdm(y = abund, formula_X = ~1, data = spider$x, ncores = 2)
## 
## Pairwise associations:
##        Alo    Alo    Alo    Arc    Arc   Aul    Par    Par   Par   Par    Tro
## Alo  0.000  0.000  0.313  0.000  0.040 0.000 -0.279  0.384 0.000 0.000 -0.028
## Alo  0.000  0.000  0.000  0.000 -0.057 0.042  0.000  0.135 0.230 0.151  0.229
## Alo  0.313  0.000  0.000  0.000  0.246 0.000  0.000  0.000 0.000 0.000 -0.218
## Arc  0.000  0.000  0.000  0.000  0.000 0.037 -0.025  0.000 0.169 0.127  0.040
## Arc  0.040 -0.057  0.246  0.000  0.000 0.000 -0.041 -0.056 0.000 0.000 -0.141
## Aul  0.000  0.042  0.000  0.037  0.000 0.000  0.000  0.020 0.191 0.249  0.100
## Par -0.279  0.000  0.000 -0.025 -0.041 0.000  0.000 -0.202 0.000 0.000  0.106
## Par  0.384  0.135  0.000  0.000 -0.056 0.020 -0.202  0.000 0.000 0.249  0.000
## Par  0.000  0.230  0.000  0.169  0.000 0.191  0.000  0.000 0.000 0.190  0.122
## Par  0.000  0.151  0.000  0.127  0.000 0.249  0.000  0.249 0.190 0.000  0.167
## Tro -0.028  0.229 -0.218  0.040 -0.141 0.100  0.106  0.000 0.122 0.167  0.000
## Zor -0.126  0.000  0.000  0.103  0.000 0.124  0.000  0.000 0.157 0.000  0.407
##        Zor
## Alo -0.126
## Alo  0.000
## Alo  0.000
## Arc  0.103
## Arc  0.000
## Aul  0.124
## Par  0.000
## Par  0.000
## Par  0.157
## Par  0.000
## Tro  0.407
## Zor  0.000
spid_graph$best_graph$cov
##             Alopacce    Alopcune    Alopfabr    Arctlute    Arctperi
## Alopacce  1.00000000 -0.10326141  0.48581270 -0.10034559  0.25141117
## Alopcune -0.10326141  1.00000000 -0.29700544  0.36603353 -0.31891565
## Alopfabr  0.48581270 -0.29700544  1.00000000 -0.20959147  0.44037904
## Arctlute -0.10034559  0.36603353 -0.20959147  1.00000000 -0.19692001
## Arctperi  0.25141117 -0.31891565  0.44037904 -0.19692001  1.00000000
## Auloalbi -0.13222399  0.50834835 -0.28386170  0.39051744 -0.26950889
## Pardlugu -0.49007120  0.07597942 -0.27944131  0.05361891 -0.18073743
## Pardmont  0.45309879  0.29399867  0.09850137  0.15333125 -0.05056864
## Pardnigr -0.15970796  0.61841611 -0.32215882  0.47898002 -0.30550588
## Pardpull -0.05217294  0.59263774 -0.26822258  0.44482744 -0.28130559
## Trocterr -0.31337335  0.62375327 -0.51051349  0.43047624 -0.44302289
## Zoraspin -0.31458251  0.50107008 -0.40414078  0.42052242 -0.33936880
##             Auloalbi    Pardlugu    Pardmont   Pardnigr    Pardpull   Trocterr
## Alopacce -0.13222399 -0.49007120  0.45309879 -0.1597080 -0.05217294 -0.3133733
## Alopcune  0.50834835  0.07597942  0.29399867  0.6184161  0.59263774  0.6237533
## Alopfabr -0.28386170 -0.27944131  0.09850137 -0.3221588 -0.26822258 -0.5105135
## Arctlute  0.39051744  0.05361891  0.15333125  0.4789800  0.44482744  0.4304762
## Arctperi -0.26950889 -0.18073743 -0.05056864 -0.3055059 -0.28130559 -0.4430229
## Auloalbi  1.00000000  0.09285768  0.22053624  0.6067252  0.61198597  0.5850001
## Pardlugu  0.09285768  1.00000000 -0.35164878  0.1120955  0.03378495  0.2466510
## Pardmont  0.22053624 -0.35164878  1.00000000  0.2228291  0.38376822  0.1350489
## Pardnigr  0.60672516  0.11209551  0.22282908  1.0000000  0.63760327  0.6537467
## Pardpull  0.61198597  0.03378495  0.38376822  0.6376033  1.00000000  0.6125370
## Trocterr  0.58500006  0.24665096  0.13504888  0.6537467  0.61253696  1.0000000
## Zoraspin  0.54064437  0.20850179  0.08708312  0.6033118  0.51069323  0.7277463
##             Zoraspin
## Alopacce -0.31458251
## Alopcune  0.50107008
## Alopfabr -0.40414078
## Arctlute  0.42052242
## Arctperi -0.33936880
## Auloalbi  0.54064437
## Pardlugu  0.20850179
## Pardmont  0.08708312
## Pardnigr  0.60331179
## Pardpull  0.51069323
## Trocterr  0.72774632
## Zoraspin  1.00000000
spid_graph$best_graph$logL
## [1] 94.25275
spid_graph$all_graphs$lambda.opt
## [1] 0.09787635
plot(spid_graph,pad=1)