tests/testthat/test_HSIC.R

# K <- matrix(runif(10), nrow=10, ncol=1)
# L <- matrix(runif(10), nrow=10, ncol=1)
# K <- K %*% t(K)
# L <- L %*% t(L)

# res1 <- HSIC(K, L)
# res2 <- HSIC(K, L, type="permutation")
# res3 <- HSIC(K, L, type="permutation", n.perm=10)
# res4 <- HSIC(K, L, shrink=TRUE)
# res5 <- HSIC(K, L, shrink=TRUE, type="permutation")
# res6 <- HSIC(K, L, shrink=TRUE, type="permutation", n.perm=10)

# expect_true(res1$HSIC >= 0)
# expect_true(res2$HSIC >= 0)
# expect_true(res3$HSIC >= 0)
# expect_true(res4$HSIC >= 0)
# expect_true(res5$HSIC >= 0)
# expect_true(res6$HSIC >= 0)

# expect_true((0 <= res1$Pval)&&(res1$Pval <= 1))
# expect_true((0 <= res2$Pval)&&(res2$Pval <= 1))
# expect_true((0 <= res3$Pval)&&(res3$Pval <= 1))
# expect_true((0 <= res4$Pval)&&(res4$Pval <= 1))
# expect_true((0 <= res5$Pval)&&(res5$Pval <= 1))
# expect_true((0 <= res6$Pval)&&(res6$Pval <= 1))
rikenbit/fuchikoma documentation built on May 27, 2019, 9:09 a.m.