unit-tests/test_offdiagonal.R

# Test the off diagonal of a block matrix ---------------------------

m <- cov2cor(fits[[2]]$Hessian)
# Test if the off diagonals in a block matrix are greater than the diagonal
# Args:
# m: a p*p matrix
test <- vector("list", length = ncol(m))
for (i in 1:ncol(m)) {
  test[[i]] <- which(abs(m[,i]) > abs(m[i,i]))
}
print(test)
# End-of-Test the off diagonal --------------------------------------------
JanvandenBrand/highdimjm documentation built on Dec. 18, 2021, 12:32 a.m.