Often needed when using estimates of Omega or Sigma matrices in further calculations.
dt2mat(pars, dt.subset = "unique", max.i, fill = 0, col.value)
A data.table with parameters. Must contain columns `i` and `j` with row and column indexes and `est` with parameter (matrix) values.
Specifies whether pars contains only a lower or upper triangle of an assumed symmetric matrix (most often the case for variance-covariance matrices), or it contains the full matrix. `dt.subset="unique"` (default) means that `pars` only contains either upper or lower diagonal matrix (including diagonal), `dt.subset="all"` means `pars` contains both upper and lower triangles. See details.
By default, the maximum row number is derived as he maximum value in the `i` column. If more (empty ones) are needed, specify the maximum row number with `max.i`. This can be necessary in cases where only estimated elements are available but a full matrix including elements related to fixed parameters is needed.
Value to insert for missing elements
The name of the column from which to take the `OMEGA` values. Default is "value" in alignment with the output from `NMreadExt()`.
a matrix
If pars does not contain all `i` values, they will be imputed with zeros. The desired matrix dimension is inferred from `min(i)` and `max(i)`. In case `dt.subset=="unique"` missing `j` elements will also give imputations of missing elements.