obs_var_from_Zs
- pyoptex.utils.design.obs_var_from_Zs(Zs, N, ratios=None, include_error=True)[source]
Computes the observation covariance matrix from the different groupings. Computed as V = I + sum(ratio * Zi Zi.T) (where Zi is the expanded grouping matrix). For example [0, 0, 1, 1] is represented by [[1, 0], [1, 0], [0, 1], [0, 1]].
Parameters
- Zstuple(np.array(1d) or None)
The tuple of grouping matrices. Can include Nones which are ignored.
- Nint
The number of runs. Necessary in case no random groups are present.
- ratiosnp.array(1d)
The variance ratios of the different groups compared to the variance of the random errors.
- include_errorbool
Whether to include the random errors or not.
Returns
- Vnp.array(2d)
The observation covariance matrix.