Diagonal covariance structure for mmer and vsr
dsr.RdCreates a diagonal variance-component structure for use by the mmer covariance-model interface, typically inside vsr. Each column or level represented by x receives its own diagonal variance component, while all off-diagonal covariance components are constrained to zero.
Details
dsr() is part of the covariance-structure interface used by mmer/vsr; it is distinct from dsm, which belongs to the newer mmes/vsm CovarianceFactor interface.
The function returns a design matrix \(Z\) and a covariance-parameter constraint matrix thetaC. If \(q\) columns or levels are represented by x, then
$$\mathrm{thetaC}=I_q.$$
Consequently, the associated covariance matrix has the form
$$\Sigma=\mathrm{diag}(\sigma_1^2,\ldots,\sigma_q^2),$$
so that the \(q\) variances are estimated separately and all covariances are fixed to zero.
For a factor or character vector, missing observations are retained through the construction of the incidence matrix. If only one non-missing level is present, a one-column incidence matrix is constructed explicitly.
For a numeric non-factor input, x is treated as a single design column rather than expanded into factor levels.