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           Aga
#> Che  2.52697814 -0.010979134  0.36146057  0.4454217 -0.0175114905  0.3093015371
#> Hyc -0.01097913  1.913684679  0.10912043  0.2678197 -0.1461127086 -0.1315181366
#> Hym  0.36146057  0.109120428  1.24561630  0.8658304 -0.1179489764  0.5148764342
#> Hys  0.44542165  0.267819684  0.86583038  2.6634873 -0.1458451779  0.4275744454
#> Psy -0.01751149 -0.146112709 -0.11794898 -0.1458452  0.0759177017  0.0008813903
#> Aga  0.30930154 -0.131518137  0.51487643  0.4275744  0.0008813903  1.1001077368
#> Glo  0.08902440  0.170672898  0.20947258  0.3417547 -0.0494534369 -0.0628544429
#> Ath  0.35258965  0.108445121  0.38587757  0.6074185 -0.0474798166  0.1984193577
#> Cea -0.01020553  0.006286386 -0.02336706 -0.0175259  0.0002229208 -0.0244072270
#> Ced  0.33761753  0.221361889  0.50816904  0.6809477 -0.0979593181  0.2194991369
#> Set -0.06109581  0.478252085 -0.18330832  0.1361124 -0.0913572624 -0.3008139064
#> All  0.27370641 -0.264334984  0.68212053  0.3718507 -0.0048054054  0.5926047605
#> Han -0.18429793  0.625923583  0.20737194  0.1327282 -0.2884528060 -0.1717090989
#> Hfo -0.36794635  0.563301946 -0.40006947 -0.1894020 -0.1457898159 -0.8149327745
#> Hsp -0.45131251  0.678032991 -0.34353798 -0.1873399 -0.1918463081 -0.7836251455
#> Hve  0.31290192 -0.132487739  0.16225128  0.2424163  0.0455951410  0.1865372164
#> Sta  0.36357042  0.256308313  0.47826683  0.6140835 -0.1212554098  0.4400389451
#>              Glo         Ath           Cea          Ced         Set
#> Che  0.089024399  0.35258965 -0.0102055272  0.337617531 -0.06109581
#> Hyc  0.170672898  0.10844512  0.0062863860  0.221361889  0.47825209
#> Hym  0.209472576  0.38587757 -0.0233670559  0.508169037 -0.18330832
#> Hys  0.341754670  0.60741848 -0.0175259004  0.680947658  0.13611243
#> Psy -0.049453437 -0.04747982  0.0002229208 -0.097959318 -0.09135726
#> Aga -0.062854443  0.19841936 -0.0244072270  0.219499137 -0.30081391
#> Glo  1.118429797  0.22425908  0.0018643379  0.226248429  0.29218028
#> Ath  0.224259077  1.37415071 -0.0072823499  0.442735421  0.09535878
#> Cea  0.001864338 -0.00728235  0.0500189656 -0.008096058  0.01680935
#> Ced  0.226248429  0.44273542 -0.0080960577  0.958423695  0.19446494
#> Set  0.292180285  0.09535878  0.0168093479  0.194464936  1.58600496
#> All -0.076731662  0.08930359 -0.0272038372  0.080650875 -0.68273067
#> Han -0.190926793 -0.19927284  0.0051659352  0.056186885 -0.04158390
#> Hfo  0.300485526 -0.16224136  0.0298559776 -0.133703678  0.81344044
#> Hsp  0.251315659 -0.22510433  0.0278260412 -0.117624171  0.77297407
#> Hve  0.088674401  0.24266431 -0.0076967099  0.204378457 -0.04182466
#> Sta  0.016815037  0.30842621 -0.0147825170  0.434702812  0.05542041
#>              All          Han         Hfo         Hsp         Hve         Sta
#> Che  0.273706415 -0.184297933 -0.36794635 -0.45131251  0.31290192  0.36357042
#> Hyc -0.264334984  0.625923583  0.56330195  0.67803299 -0.13248774  0.25630831
#> Hym  0.682120533  0.207371937 -0.40006947 -0.34353798  0.16225128  0.47826683
#> Hys  0.371850654  0.132728189 -0.18940196 -0.18733992  0.24241627  0.61408352
#> Psy -0.004805405 -0.288452806 -0.14578982 -0.19184631  0.04559514 -0.12125541
#> Aga  0.592604761 -0.171709099 -0.81493277 -0.78362515  0.18653722  0.44003895
#> Glo -0.076731662 -0.190926793  0.30048553  0.25131566  0.08867440  0.01681504
#> Ath  0.089303588 -0.199272835 -0.16224136 -0.22510433  0.24266431  0.30842621
#> Cea -0.027203837  0.005165935  0.02985598  0.02782604 -0.00769671 -0.01478252
#> Ced  0.080650875  0.056186885 -0.13370368 -0.11762417  0.20437846  0.43470281
#> Set -0.682730673 -0.041583897  0.81344044  0.77297407 -0.04182466  0.05542041
#> All  1.807579025  0.028730854 -0.74502353 -0.66360976  0.14746202  0.20004445
#> Han  0.028730854  3.665314173  0.62274755  0.99178020 -0.60114900  0.46466809
#> Hfo -0.745023530  0.622747547  2.76356179  1.64737314 -0.34530648 -0.25687533
#> Hsp -0.663609756  0.991780205  1.64737314  2.55148787 -0.48695770 -0.19576042
#> Hve  0.147462019 -0.601148998 -0.34530648 -0.48695770  1.34897495  0.14357089
#> Sta  0.200044454  0.464668088 -0.25687533 -0.19576042  0.14357089  1.02925215