tests/testthat/test-cholesky_root.R

test_that("Cholesky decomposition works", {
  cov <- sample_covariance_matrix(5)
  chol <- cov_to_chol(cov)
  expect_true(all.equal(cov, chol_to_cov(chol)))
  chol <- cov_to_chol(cov)
  expect_true(all.equal(cov, chol_to_cov(chol)))
  expect_equal(unique_chol(numeric()), numeric())
  expect_equal(cov_to_chol(matrix(0, 2, 2)), c(0, 0, 0))
})

Try the oeli package in your browser

Any scripts or data that you put into this service are public.

oeli documentation built on Oct. 16, 2024, 5:08 p.m.