Extract the variance-covariance matrix of the residuals, usually noted $$\Sigma$$ in PLN models. This captures the correlation between the species in the latent space.

# S3 method for class 'PLNfit'
sigma(object, ...)

Arguments

object

an R6 object with class PLNfit

...

additional parameters for S3 compatibility. Not used

Value

A semi definite positive matrix of size p, assuming there are p species in the model.

See also

coef.PLNfit(), standard_error.PLNfit() and vcov.PLNfit() for other ways to access $$\Sigma$$.

Examples

data(trichoptera)
trichoptera <- prepare_data(trichoptera$Abundance, trichoptera$Covariate)
myPLN <- PLN(Abundance ~ 1 + offset(log(Offset)), data = trichoptera)
#> 
#>  Initialization...
#>  Adjusting a full covariance PLN model with nlopt optimizer
#>  Post-treatments...
#>  DONE!
sigma(myPLN) ## Sigma
#>              Che          Hyc         Hym         Hys           Psy
#> Che  2.533889720 -0.009175274  0.35957652  0.44466341 -0.0177497070
#> Hyc -0.009175274  1.905879266  0.11079420  0.27009605 -0.1465535916
#> Hym  0.359576519  0.110794195  1.24533901  0.86551787 -0.1186220053
#> Hys  0.444663406  0.270096053  0.86551787  2.66556486 -0.1467153805
#> Psy -0.017749707 -0.146553592 -0.11862201 -0.14671538  0.0762253676
#> Aga  0.308321103 -0.132763441  0.51430623  0.42597249  0.0014030755
#> Glo  0.089673185  0.171534660  0.20986385  0.34296412 -0.0498898408
#> Ath  0.352594596  0.110096779  0.38518930  0.60794017 -0.0479791664
#> Cea -0.012865858  0.008339850 -0.02989049 -0.02216642  0.0001971436
#> Ced  0.337752005  0.222223228  0.50794425  0.68137474 -0.0983619419
#> Set -0.057984731  0.477377565 -0.18190346  0.13879491 -0.0915290277
#> All  0.271550918 -0.264260088  0.68178886  0.37027126 -0.0046779521
#> Han -0.183825874  0.625434397  0.20947619  0.13505358 -0.2887008025
#> Hfo -0.362486242  0.562768586 -0.39308133 -0.18182254 -0.1466276209
#> Hsp -0.440850931  0.672803405 -0.33156766 -0.17514684 -0.1917594046
#> Hve  0.312710542 -0.132538210  0.16092145  0.24110818  0.0459239339
#> Sta  0.363674354  0.256553019  0.47822213  0.61413322 -0.1214490338
#>              Aga          Glo          Ath           Cea         Ced
#> Che  0.308321103  0.089673185  0.352594596 -0.0128658585  0.33775200
#> Hyc -0.132763441  0.171534660  0.110096779  0.0083398498  0.22222323
#> Hym  0.514306230  0.209863852  0.385189302 -0.0298904888  0.50794425
#> Hys  0.425972486  0.342964118  0.607940170 -0.0221664157  0.68137474
#> Psy  0.001403075 -0.049889841 -0.047979166  0.0001971436 -0.09836194
#> Aga  1.101569698 -0.063875964  0.197235416 -0.0314309541  0.21881525
#> Glo -0.063875964  1.118991217  0.225184485  0.0025360967  0.22678393
#> Ath  0.197235416  0.225184485  1.376146797 -0.0091019457  0.44314315
#> Cea -0.031430954  0.002536097 -0.009101946  0.0654281204 -0.01006807
#> Ced  0.218815247  0.226783927  0.443143154 -0.0100680670  0.95893264
#> Set -0.301831869  0.293079136  0.097799325  0.0219083881  0.19555373
#> All  0.593993436 -0.077455058  0.087851750 -0.0351846095  0.07998615
#> Han -0.172684447 -0.188895362 -0.197875167  0.0068488109  0.05656817
#> Hfo -0.814522552  0.301939203 -0.157041946  0.0384375867 -0.12949792
#> Hsp -0.778037422  0.252204569 -0.216016044  0.0356050763 -0.11037546
#> Hve  0.187362344  0.088242670  0.242045904 -0.0098605695  0.20386452
#> Sta  0.439979141  0.016824335  0.308424290 -0.0187003167  0.43470270
#>             Set          All          Han         Hfo         Hsp         Hve
#> Che -0.05798473  0.271550918 -0.183825874 -0.36248624 -0.44085093  0.31271054
#> Hyc  0.47737756 -0.264260088  0.625434397  0.56276859  0.67280340 -0.13253821
#> Hym -0.18190346  0.681788864  0.209476188 -0.39308133 -0.33156766  0.16092145
#> Hys  0.13879491  0.370271261  0.135053582 -0.18182254 -0.17514684  0.24110818
#> Psy -0.09152903 -0.004677952 -0.288700802 -0.14662762 -0.19175940  0.04592393
#> Aga -0.30183187  0.593993436 -0.172684447 -0.81452255 -0.77803742  0.18736234
#> Glo  0.29307914 -0.077455058 -0.188895362  0.30193920  0.25220457  0.08824267
#> Ath  0.09779933  0.087851750 -0.197875167 -0.15704195 -0.21601604  0.24204590
#> Cea  0.02190839 -0.035184609  0.006848811  0.03843759  0.03560508 -0.00986057
#> Ced  0.19555373  0.079986150  0.056568170 -0.12949792 -0.11037546  0.20386452
#> Set  1.58232207 -0.682943148 -0.040351378  0.80960874  0.76426656 -0.04129266
#> All -0.68294315  1.808582280  0.028944720 -0.74247834 -0.65677918  0.14736677
#> Han -0.04035138  0.028944720  3.643028041  0.62396079  0.98584688 -0.60099103
#> Hfo  0.80960874 -0.742478342  0.623960795  2.74198623  1.62545708 -0.34459986
#> Hsp  0.76426656 -0.656779179  0.985846881  1.62545708  2.49072135 -0.48151031
#> Hve -0.04129266  0.147366767 -0.600991032 -0.34459986 -0.48151031  1.34986122
#> Sta  0.05561555  0.199889141  0.463860791 -0.25480433 -0.19111380  0.14335148
#>             Sta
#> Che  0.36367435
#> Hyc  0.25655302
#> Hym  0.47822213
#> Hys  0.61413322
#> Psy -0.12144903
#> Aga  0.43997914
#> Glo  0.01682434
#> Ath  0.30842429
#> Cea -0.01870032
#> Ced  0.43470270
#> Set  0.05561555
#> All  0.19988914
#> Han  0.46386079
#> Hfo -0.25480433
#> Hsp -0.19111380
#> Hve  0.14335148
#> Sta  1.02963242