tests/testthat/test-log_densities.R

context("Check the simplified log densities against the densities")

test_that("exp(log IG density) returns the IG density", {
  for (cpar_ in .cpar) {
    expect_equal(
      dig(.u, .v, theta = cpar_[1], alpha = cpar_[2]),
      exp(logdig(.u, .v, theta = cpar_[1], alpha = cpar_[2]))
    )
  }
})

test_that("exp(log IGL density) returns the IGL density", {
  for (alpha_ in .alpha) {
    expect_equal(
      digl(.u, .v, alpha = alpha_),
      exp(logdigl(.u, .v, alpha = alpha_))
    )
  }
})

Try the igcop package in your browser

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

igcop documentation built on Nov. 14, 2023, 5:10 p.m.