Skip to content

Commit

Permalink
backwards change from logic regr to not use the pseudopar parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
aliaksah committed Apr 23, 2024
1 parent e54e982 commit 9a55359
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 9 deletions.
5 changes: 2 additions & 3 deletions R/LogicRegr.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
#' @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 @@ -45,7 +44,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,
pseudopar = TRUE,n.mods = 1000, print.freq = 1000L,
n.mods = 1000, print.freq = 1000L,
advanced = list(
presearch = TRUE,locstop = FALSE,
estimator = estimate.logic.bern.tCCH,
Expand Down Expand Up @@ -116,7 +115,7 @@ LogicRegr = function(

return(
pinferunemjmcmc(
n.cores = ncores, mcgmj = ifelse(pseudopar,mcgmjpse, mcgmjpar), report.level = report.level, simplify = TRUE,
n.cores = ncores, 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/mcgmj.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

mcgmjpar = function(X,FUN,mc.cores) parallel::mclapply(X= X,FUN = FUN,mc.preschedule = T,mc.cores = mc.cores)

mcgmjpse = function(X,FUN,mc.cores) ifelse(.Platform[[1]]=="unix",parallel::mclapply(X= X,FUN = FUN,mc.preschedule = T,mc.cores = mc.cores), lapply(X,FUN))
mcgmjpse = function(X,FUN,mc.cores) if(.Platform[[1]]=="unix") parallel::mclapply(X= X,FUN = FUN,mc.preschedule = T,mc.cores = mc.cores) else lapply(X,FUN)
4 changes: 2 additions & 2 deletions inst/examples/LogicRegr_example.R
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ n_cores <- parallel::detectCores() - 1
res4G <- LogicRegr(
formula = formula1, data = data.example, family = "Gaussian", prior = "G",
report.level = 0.5, d = 15, cmax = 2, kmax = 15, p.and = 0.9, p.not = 0.01,
p.surv = 0.2, ncores = n_cores,pseudopar = TRUE
p.surv = 0.2, ncores = n_cores
)
print(res4G$feat.stat)

# run the inference with Jeffrey's prior
res4J <- LogicRegr(
formula = formula1, data = data.example, family = "Gaussian", prior = "J",
report.level = 0.5, d = 15, cmax = 2, kmax = 15, p.and = 0.9, p.not = 0.01,
p.surv = 0.2, ncores = n_cores,pseudopar = TRUE
p.surv = 0.2, ncores = n_cores
)
print(res4J$feat.stat)
}
3 changes: 0 additions & 3 deletions man/LogicRegr.Rd

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

0 comments on commit 9a55359

Please sign in to comment.