tests/testthat/testValuateOnePolicy.R

context("valuation of one guaratee contract")
library(vamc)

fundScen <- genFundScen(fundMap, indexScen)[1:2, , ]
test_that("test for the correctness of valuation", {
  testPolicy <- VAPort[1, ]
  expect_equal(valuateOnePolicy(testPolicy, mortTable, fundScen,
                                1 / 12, cForwardCurve),
               list(policyValue = 0, riskCharge = 454.1419), tolerance = 1)
})

Try the vamc package in your browser

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

vamc documentation built on Feb. 28, 2020, 5:08 p.m.