Skip to content

Commit b660efe

Browse files
Resolve merge conflicts
2 parents 8239504 + e008ffd commit b660efe

File tree

971 files changed

+57691
-6208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

971 files changed

+57691
-6208
lines changed

.Rbuildignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,5 @@
99
^docs$
1010
^pkgdown$
1111
^vignettes/introduction_cache
12+
^doc$
13+
^Meta$

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ src/*.o
66
src/*.so
77
src/*.dll
88
inst/doc
9-
.DS_Store
9+
.DS_Store

DESCRIPTION

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,11 @@ Package: bgms
22
Type: Package
33
Title: Bayesian Analysis of Networks of Binary and/or Ordinal Variables
44
Version: 0.1.5.0
5+
<<<<<<< HEAD
56
Date: 2025-08-03
7+
=======
8+
Date: 2025-06-27
9+
>>>>>>> adaMala
610
Authors@R: c(
711
person("Maarten", "Marsman", , "m.marsman@uva.nl", role = c("aut", "cre"),
812
comment = c(ORCID = "0000-0001-5309-7502")),
@@ -21,9 +25,9 @@ Copyright: Includes datasets 'ADHD' and 'Boredom', which are licensed under CC-B
2125
License: GPL (>= 2)
2226
URL: https://Bayesian-Graphical-Modelling-Lab.github.io/bgms/
2327
BugReports: https://github.com/Bayesian-Graphical-Modelling-Lab/bgms/issues
24-
Imports: Rcpp (>= 1.0.7), Rdpack, methods
28+
Imports: Rcpp (>= 1.0.7), RcppParallel, Rdpack, methods, coda, dqrng
2529
RdMacros: Rdpack
26-
LinkingTo: Rcpp, RcppProgress, RcppArmadillo
30+
LinkingTo: Rcpp, RcppProgress, RcppArmadillo, RcppParallel, dqrng, BH
2731
RoxygenNote: 7.3.2
2832
Depends:
2933
R (>= 3.5)
@@ -32,9 +36,11 @@ Encoding: UTF-8
3236
Suggests:
3337
ggplot2,
3438
knitr,
39+
parallel,
3540
qgraph,
41+
posterior,
3642
rmarkdown,
3743
testthat (>= 3.0.0)
3844
VignetteBuilder: knitr
3945
Config/testthat/edition: 3
40-
Config/Needs/website: tidyverse/tidytemplate
46+
Config/Needs/website: tidyverse/tidytemplate

Meta/vignette.rds

305 Bytes
Binary file not shown.

NAMESPACE

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Generated by roxygen2: do not edit by hand
22

3+
S3method(as_draws,bgms)
4+
S3method(coef,bgms)
35
S3method(extract_arguments,bgmCompare)
46
S3method(extract_arguments,bgms)
57
S3method(extract_indicator_priors,bgmCompare)
@@ -10,23 +12,32 @@ S3method(extract_posterior_inclusion_probabilities,bgmCompare)
1012
S3method(extract_posterior_inclusion_probabilities,bgms)
1113
S3method(print,bgmCompare)
1214
S3method(print,bgms)
15+
S3method(print,summary.bgms)
16+
S3method(summary,bgms)
1317
export(bgm)
1418
export(bgmCompare)
1519
export(extract_arguments)
16-
export(extract_category_thresholds)
20+
export(extract_category_thresholds.bgms)
1721
export(extract_edge_indicators)
1822
export(extract_indicator_priors)
1923
export(extract_indicators)
2024
export(extract_main_difference.bgmCompare)
2125
export(extract_pairwise_difference.bgmCompare)
22-
export(extract_pairwise_interactions)
26+
export(extract_pairwise_interactions.bgms)
2327
export(extract_pairwise_thresholds)
2428
export(extract_posterior_inclusion_probabilities)
2529
export(mrfSampler)
26-
export(summarySBM)
30+
import(RcppParallel)
2731
importFrom(Rcpp,evalCpp)
32+
importFrom(RcppParallel,defaultNumThreads)
33+
importFrom(RcppParallel,setThreadOptions)
2834
importFrom(Rdpack,reprompt)
35+
importFrom(coda,effectiveSize)
36+
importFrom(coda,gelman.diag)
37+
importFrom(coda,mcmc)
38+
importFrom(coda,mcmc.list)
2939
importFrom(methods,hasArg)
40+
importFrom(posterior,as_draws)
3041
importFrom(stats,dpois)
3142
importFrom(utils,packageVersion)
3243
useDynLib(bgms, .registration=TRUE)

R/RcppExports.R

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,22 @@ rcpp_ieee754_log <- function(x) {
1313
.Call(`_bgms_rcpp_ieee754_log`, x)
1414
}
1515

16-
sample_omrf_gibbs <- function(no_states, no_variables, no_categories, interactions, thresholds, iter) {
17-
.Call(`_bgms_sample_omrf_gibbs`, no_states, no_variables, no_categories, interactions, thresholds, iter)
16+
run_bgmCompare_parallel <- function(observations, num_groups, counts_per_category, blume_capel_stats, pairwise_stats, num_categories, main_alpha, main_beta, pairwise_scale, difference_scale, difference_selection_alpha, difference_selection_beta, difference_prior, iter, burnin, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, difference_selection, main_effect_indices, pairwise_effect_indices, target_accept, nuts_max_depth, learn_mass_matrix, projection, group_membership, group_indices, interaction_index_matrix, inclusion_probability, num_chains, nThreads, seed, update_method, hmc_num_leapfrogs) {
17+
.Call(`_bgms_run_bgmCompare_parallel`, observations, num_groups, counts_per_category, blume_capel_stats, pairwise_stats, num_categories, main_alpha, main_beta, pairwise_scale, difference_scale, difference_selection_alpha, difference_selection_beta, difference_prior, iter, burnin, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, difference_selection, main_effect_indices, pairwise_effect_indices, target_accept, nuts_max_depth, learn_mass_matrix, projection, group_membership, group_indices, interaction_index_matrix, inclusion_probability, num_chains, nThreads, seed, update_method, hmc_num_leapfrogs)
1818
}
1919

20-
sample_bcomrf_gibbs <- function(no_states, no_variables, no_categories, interactions, thresholds, variable_type, reference_category, iter) {
21-
.Call(`_bgms_sample_bcomrf_gibbs`, no_states, no_variables, no_categories, interactions, thresholds, variable_type, reference_category, iter)
20+
run_bgm_parallel <- function(observations, num_categories, pairwise_scale, edge_prior, inclusion_probability, beta_bernoulli_alpha, beta_bernoulli_beta, dirichlet_alpha, lambda, interaction_index_matrix, iter, burnin, counts_per_category, blume_capel_stats, main_alpha, main_beta, na_impute, missing_index, is_ordinal_variable, baseline_category, edge_selection, update_method, pairwise_effect_indices, target_accept, pairwise_stats, hmc_num_leapfrogs, nuts_max_depth, learn_mass_matrix, num_chains, nThreads, seed) {
21+
.Call(`_bgms_run_bgm_parallel`, observations, num_categories, pairwise_scale, edge_prior, inclusion_probability, beta_bernoulli_alpha, beta_bernoulli_beta, dirichlet_alpha, lambda, interaction_index_matrix, iter, burnin, counts_per_category, blume_capel_stats, main_alpha, main_beta, na_impute, missing_index, is_ordinal_variable, baseline_category, edge_selection, update_method, pairwise_effect_indices, target_accept, pairwise_stats, hmc_num_leapfrogs, nuts_max_depth, learn_mass_matrix, num_chains, nThreads, seed)
2222
}
2323

24-
gibbs_sampler <- function(observations, indicator, interactions, thresholds, no_categories, interaction_scale, proposal_sd, proposal_sd_blumecapel, edge_prior, theta, beta_bernoulli_alpha, beta_bernoulli_beta, dirichlet_alpha, lambda, Index, iter, burnin, n_cat_obs, sufficient_blume_capel, threshold_alpha, threshold_beta, na_impute, missing_index, variable_bool, reference_category, save = FALSE, display_progress = FALSE, edge_selection = TRUE) {
25-
.Call(`_bgms_gibbs_sampler`, observations, indicator, interactions, thresholds, no_categories, interaction_scale, proposal_sd, proposal_sd_blumecapel, edge_prior, theta, beta_bernoulli_alpha, beta_bernoulli_beta, dirichlet_alpha, lambda, Index, iter, burnin, n_cat_obs, sufficient_blume_capel, threshold_alpha, threshold_beta, na_impute, missing_index, variable_bool, reference_category, save, display_progress, edge_selection)
24+
sample_omrf_gibbs <- function(no_states, no_variables, no_categories, interactions, thresholds, iter) {
25+
.Call(`_bgms_sample_omrf_gibbs`, no_states, no_variables, no_categories, interactions, thresholds, iter)
2626
}
2727

28-
compare_anova_gibbs_sampler <- function(observations, main_effect_indices, pairwise_effect_indices, projection, num_categories, num_groups, group_indices, interaction_scale, pairwise_difference_scale, main_difference_scale, pairwise_difference_prior, main_difference_prior, inclusion_probability_difference, pairwise_beta_bernoulli_alpha, pairwise_beta_bernoulli_beta, main_beta_bernoulli_alpha, main_beta_bernoulli_beta, Index, iter, burnin, num_obs_categories, sufficient_blume_capel, prior_threshold_alpha, prior_threshold_beta, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, independent_thresholds, save_main = FALSE, save_pairwise = FALSE, save_indicator = FALSE, display_progress = FALSE, difference_selection = TRUE) {
29-
.Call(`_bgms_compare_anova_gibbs_sampler`, observations, main_effect_indices, pairwise_effect_indices, projection, num_categories, num_groups, group_indices, interaction_scale, pairwise_difference_scale, main_difference_scale, pairwise_difference_prior, main_difference_prior, inclusion_probability_difference, pairwise_beta_bernoulli_alpha, pairwise_beta_bernoulli_beta, main_beta_bernoulli_alpha, main_beta_bernoulli_beta, Index, iter, burnin, num_obs_categories, sufficient_blume_capel, prior_threshold_alpha, prior_threshold_beta, na_impute, missing_data_indices, is_ordinal_variable, baseline_category, independent_thresholds, save_main, save_pairwise, save_indicator, display_progress, difference_selection)
28+
sample_bcomrf_gibbs <- function(no_states, no_variables, no_categories, interactions, thresholds, variable_type, reference_category, iter) {
29+
.Call(`_bgms_sample_bcomrf_gibbs`, no_states, no_variables, no_categories, interactions, thresholds, variable_type, reference_category, iter)
3030
}
3131

3232
compute_Vn_mfm_sbm <- function(no_variables, dirichlet_alpha, t_max, lambda) {
3333
.Call(`_bgms_compute_Vn_mfm_sbm`, no_variables, dirichlet_alpha, t_max, lambda)
34-
}
35-
34+
}

0 commit comments

Comments
 (0)