extract_variance_covariance function

Extract sub-matrices of variance.