gemmr.generative_model.calc_schur_complement

gemmr.generative_model.calc_schur_complement(A, B_or_px, C=None, D=None, kind='auto')

Calculate Schur complement of a matrix.

Parameters:
  • A (np.ndarray) – Can either specify the complete 2x2 block matrix, in which case argument B_or_px needs to be an integer giving the dimension of the upper left block (i.e. A[:B_or_px, :B_or_px] is the upper left block) and C and D are ignored, or A is the upper left block, in which case B_or_px is assumed to be a matrix
  • B_or_px (int or np.ndarray) – If int, gives the size of the upper left block, if array, specifies the upper right block.
  • C (ignored or np.ndarray) – lower left block in case B_or_px is an array, ignored otherwise
  • D (ignored or np.ndarray) – lower right block in case B_or_px is an array, ignored otherwise
  • kind ("A" or "D") – whether to calculate the Schur complement of block “A” or “D”
Returns:

Schur complement – same shape as block A or D, depending on value of kind

Return type:

np.ndarray