## S3 method for class 'glmmTMB'VarCorr(x, sigma =1,...)
Arguments
x: a fitted glmmTMB model
sigma: residual standard deviation (usually set automatically from internal information)
...: extra arguments (for consistency with generic method)
Details
For an unstructured variance-covariance matrix, the internal parameters are structured as follows: the first n parameters are the log-standard-deviations, while the remaining n(n-1)/2 parameters are the elements of the Cholesky factor of the correlation matrix, filled in column-wise order (see the TMB documentation
for further details).
Examples
## Comparing variance-covariance matrix with manual computationdata("sleepstudy",package="lme4")fm4 <- glmmTMB(Reaction ~ Days +(Days|Subject), sleepstudy)VarCorr(fm4)[[c("cond","Subject")]]## hand calculationpars <- getME(fm4,"theta")## construct cholesky factorL <- diag(2)L[lower.tri(L)]<- pars[-(1:2)]C <- crossprod(L)diag(C)<-1sdvec <- exp(pars[1:2])(V <- outer(sdvec,sdvec)* C)