tests/testthat/test-Design.R

test_that("Design.matrix", {
  kn=3; degree=2; q=kn+degree+1
  design = Design.matrix(Z, cbind(1, X), kn, degree)
  expect_equal(ncol(design$Xns), (ncol(X)+1)*q)
  expect_true(all(design$X[,(1:q)] == design$Xns[,(1:q)]))
  B = design$Xns[,-(1:q)]
  B = B[,c(TRUE, rep(FALSE, (q-1)))]
  expect_equal(ncol(B), ncol(X))
  expect_equal(B, design$X[,((1:ncol(X))+q)])
})

Try the spinBayes package in your browser

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

spinBayes documentation built on May 29, 2024, 8:38 a.m.