- qspec.analyze.covariance_matrix ( cov = None , sigma = None , corr = None , k = None , n = None )[source]
Helper function to construct covariance matrices $\mathbf{\Sigma}_i\in\mathbb{R}^{n\times n}$ from standard deviations $\vec{\sigma}_i\in\mathbb{R}^n$ and correlation matrices $\mathbf{\rho}_i\in\mathbb{R}^{n\times n}$.
- Parameters:
-
- covndarray | Iterable
The covariance matrices $\mathbf{\Sigma}_i$. Must have shape
(k, n, n), wherekis the number of data points andnthe number of dimensions of each data point. IfNone, the other parameters are used. Else, all other parameters are ignored.- sigmandarray | Iterable
The standard deviations of the data vectors. Must have shape
(k, n). IfNone, all diagonal elements of the covariance matrix equal 1.- corrndarray | Iterable
The correlation matrices of the data vectors. Must have shape
(k, n, n). Ifn == 2it can have shape(k, ). IfNone, all off-diagonal elements of the covariance matrix are 0.- kint
The number of data points. It is omitted if
sigmaorcorris specified.- nint
The number of dimensions $n$ of each data point. It is omitted if
sigmaorcorris specified.
- Returns:
-
- covndarray
Covariance matrices $\mathbf{\Sigma}_i$ constructed from
sigmaandcorr.