tests/testthat/test-yields.R

test_that("yields", {
  yields <- ypr_yields(ypr_population())
  expect_identical(length(yields), 100L)
  expect_equal(
    yields[1:30],
    c(0, 0.0125655887593608, 0.0235597141355363, 0.0330917049865382,
      0.0412607851754255, 0.048157113623006, 0.0538627186048196,
      0.058452335725343, 0.0619941583642652, 0.0645505087847466,
      0.066178437516296, 0.0669302580712661, 0.0668540235213726,
      0.0659939509476679, 0.0643907992836692, 0.0620822055972294,
      0.0591029844031837, 0.0554853941670425, 0.051259374751361,
      0.046452759172189, 0.0410914626742239, 0.0351996518007257,
      0.0287998958282791, 0.0219133026570864, 0.0145596409942707,
      0.00675745043986355, 0, 0, 0, 0
    )
  )
})
poissonconsulting/ypr documentation built on April 4, 2023, 8:35 p.m.