tests/testthat/test-summary-vharlse.R

test_that("VHAR Coefficients Summary Table", {
  skip_on_cran()
  
  num_col <- 2
  fit_test_vhar <- vhar_lm(etf_vix[, seq_len(num_col)])
  fit_vhar_summary <- summary(fit_test_vhar)
  term_summary <- fit_vhar_summary$coefficients[, "term"]

  expect_equal(
    gsub(pattern = "\\..*", replacement = "", term_summary)[seq_len(fit_test_vhar$df)],
    rownames(fit_test_vhar$coefficients)
  )

  expect_equal(
    unique(gsub(pattern = ".*\\.", replacement = "", term_summary)),
    colnames(fit_test_vhar$coefficients)
  )
})

Try the bvhar package in your browser

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

bvhar documentation built on April 4, 2025, 5:22 a.m.