matrixweave {complexlm} | R Documentation |
Combine covariance matrix and pseudo covariance matrix into a "double covariance matrix"
Description
Interleaves the elements of a (p x p)
matrix with those of a different (p x p)
matrix to form a (2p x 2p)
matrix.
This function was originally made to combine the covariance and pseudo covariance matrices of a
complex random vector into a single "double covariance matrix", as described in (van den Bos 1995). However, it will accept
and operate on matrices of any storage mode.
Usage
matrixweave(cov, pcov, FUNC = Conj)
Arguments
cov |
A square matrix, such as one describing the covariance between two complex random vectors. |
pcov |
A square matrix with the same size as cov. Perhaps a pseudo covariance matrix. |
FUNC |
A function to operate on the elements of |
Value
A square matrix with dimension twice that of the input matrices. Each element of which is an element from one of the inputs, and its nearest non-diagonal neighbors are from the other input.
Half of the elements from pcov
present in the output matrix are replaced by FUNC
operated on them. Thus if two 2x2 matrices, A
and B
are given to matrixweave()
, the elements of the result are:
matrixweave(A,B)[i,j] = if(i+j is even) A[ceiling(i/2), ceiling(j/2)]
if(i+j is odd and i > j) B[ceiling(i/2), ceiling(j/2)]
if(i+j is odd and i < j) FUNC(B[ceiling(i/2),ceiling(j/2)])
References
A. van den Bos, The Multivariate Complex Normal Distribution-a Generalization, IEEE Trans. Inform. Theory 41, 537 (1995).
See Also
mahalanobis, vcov.zlm, vcov.rzlm
Examples
set.seed(4242)
mata <- matrix(rnorm(9), nrow = 3)
matb <- matrix(rnorm(9), nrow = 3)
matrixweave(mata, matb)