tests/testthat/test-h.R

test_that("hazard function", {
  t <- 3
  p1 <- c(0, 1, 2, 3)
  lambda <- c(0.1, 0.2, 0.3)

  expect_equal(h(t, p1, lambda), 0.3)
  expect_equal(h(c(1.5, 2), p1, lambda), c(0.2, 0.2))
})
josbop/BayesBiSurv documentation built on June 15, 2020, 3:45 a.m.