diff --git a/tests/testthat/test_kldggd.R b/tests/testthat/test_kldggd.R index 6f4e7539404c063a1c36c53e9c6355b099d7c02a..635d0b87bd83abaa98deffff535869361212b16b 100644 --- a/tests/testthat/test_kldggd.R +++ b/tests/testthat/test_kldggd.R @@ -74,27 +74,3 @@ test_that("kl works (dim 5)", { expect_equal(as.numeric(kl12_d5), kl12Matlab_d5) expect_equal(as.numeric(kl21_d5), kl21Matlab_d5) }) - -# Dimension p = 6 - -beta1 <- 0.74 -beta2 <- 0.55 -Sigma1 = matrix(c(0.8, 0.3, 0.2, 0, 0, 0, 0.3, 0.2, 0.1, 0, 0, 0, - 0.2, 0.1, 0.2, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 , 0, 1), nrow = 6) -Sigma2 = matrix(c(1, 0.3, 0.2, 0, 0, 0, 0.3, 0.5, 0.1, 0, 0, 0, - 0.2, 0.1, 0.7, 0, 0, 0, 0, 0, 0, 1, 0, 0, - 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 3), nrow = 6) -kl12Matlab_d6 <- 3.367857801981060 -kl21Matlab_d6 <- 16.157323374492506 - -kl12_d6 <- kldggd(Sigma1, beta1, Sigma2, beta2, eps = 1e-5) -kl21_d6 <- kldggd(Sigma2, beta2, Sigma1, beta1, eps = 1e-6) - -test_that("kl works (dim 6)", { - expect_equal(attr(kl12_d6, "eps"), 1e-5) - expect_equal(attr(kl21_d6, "eps"), 1e-6) - - expect_equal(as.numeric(kl12_d6), kl12Matlab_d6) - expect_equal(as.numeric(kl21_d6), kl21Matlab_d6) -})