Skip to content

Commit

Permalink
update test for MCMC+BAS to check if tree is updated
Browse files Browse the repository at this point in the history
and add nocov to edcase that can't be reached
  • Loading branch information
merliseclyde committed Dec 8, 2023
1 parent 3308930 commit 34f0eef
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/glm_mcmcbas.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,10 +254,10 @@ SEXP glm_mcmcbas(SEXP Y, SEXP X, SEXP Roffset, SEXP Rweights,
}
//Rprintf("Nunique = %d, m = %d, k = %d, mcurrent = %d %lf\n",
// nUnique, m, k, mcurrent, pigamma[0]);
if (m < k) {
mcurrent = m;
if (m < k) {
mcurrent = m; // #nocov
}
else {mcurrent = k;}
else {mcurrent = k;}
}

// # nocov start
Expand Down
4 changes: 2 additions & 2 deletions tests/testthat/test-bas-glm.R
Original file line number Diff line number Diff line change
Expand Up @@ -474,11 +474,11 @@ test_that("MCMC+BAS", {
expect_equal(pima_BAS$n.models, pima_2$n.models)

set.seed(42)
pima_BAS <- bas.glm(type ~ bp + npreg + bmi,
pima_BAS <- bas.glm(type ~ .,
data = Pima.tr, method = "MCMC+BAS",
betaprior = bic.prior(),
family = binomial(),
modelprior = uniform(), MCMC.iterations = 5, update = 2 )
modelprior = uniform(), MCMC.iterations = 5, update = 50)
expect_equal(6, sum(pima_BAS$freq))
})

Expand Down

0 comments on commit 34f0eef

Please sign in to comment.