Computes \(\Sigma = A^{-1} B (A^{-1})^T \) with provided \(A\) and \(B\) matrices.

compute_sigma(A, B, solver = solve)

Arguments

A

a matrix, generally the .A slot in a sandwich_components object created in estimate_sandwich_matrices

B

a matrix, generally the .B slot in a sandwich_components object created in estimate_sandwich_matrices

solver

the function used to compute the inverse of A, Defaults to solve

Value

the matrixAinv %*% B %*% t(Ainv)

Examples

A <- diag(2, nrow = 2, ncol = 2)
B <- matrix(4, nrow = 2, ncol = 2)
compute_sigma(A = A, B = B)
#>      [,1] [,2]
#> [1,]    1    1
#> [2,]    1    1