Skip to content

Commit

Permalink
added pseudopar to logic regression to control whether or not mclappl…
Browse files Browse the repository at this point in the history
…y or lapply will be used to run multiple chains (the latter is the only option for Windows OS and is required to pass all tests under all OS on cran)
  • Loading branch information
aliaksah committed Apr 20, 2024
1 parent d6c2fac commit 4873ddb
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/LogicRegr.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' @param p.surv minimal survival probabilities for the features to be allowed to enter the next population
#' @param ncores the maximal number of cores (and GMJMCMC threads) to be
#' addressed in the analysis
#' @param pseudopar whether the ncores chains will run in sequentially (the only option under Windows OS) or in parallel
#' @param n.mods the number of the best models in the thread to calculate
#' marginal inclusion probabilities
#' @param advanced should only be adrresed by experienced users to tune advanced
Expand All @@ -44,7 +45,7 @@
LogicRegr = function(
formula, data, family = "Gaussian",prior = "J",report.level = 0.5, d = 20,
cmax = 5, kmax = 20, p.and = 0.9, p.not = 0.05, p.surv = 0.1, ncores = -1,
n.mods = 1000, print.freq = 1000L,
pseudopar = TRUE,n.mods = 1000, print.freq = 1000L,
advanced = list(
presearch = TRUE,locstop = FALSE,
estimator = estimate.logic.bern.tCCH,
Expand Down Expand Up @@ -115,7 +116,7 @@ LogicRegr = function(

return(
pinferunemjmcmc(
n.cores = ncores, mcgmj = mcgmjpar, report.level = report.level, simplify = TRUE,
n.cores = ncores, mcgmj = ifelse(pseudopar,mcgmjpse, mcgmjpar), report.level = report.level, simplify = TRUE,
num.mod.best = n.mods, predict = FALSE, runemjmcmc.params = advanced
)
)
Expand Down
2 changes: 1 addition & 1 deletion R/pinferunemjmcmc.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#' @keywords methods models
#' @export
pinferunemjmcmc = function(
n.cores = 4, mcgmj = mcgmjpar, report.level = 0.5, simplify = FALSE,
n.cores = 4,pseudopar = TRUE, mcgmj = mcgmjpse, report.level = 0.5, simplify = FALSE,
num.mod.best = 1000, predict = FALSE, test.data = 1,
link.function = function(z)z, runemjmcmc.params
) {
Expand Down
3 changes: 3 additions & 0 deletions man/LogicRegr.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions man/pinferunemjmcmc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4873ddb

Please sign in to comment.