Skip to content

Conversation

@sekulovskin
Copy link
Contributor

I have implemented the two sets of shape hyperparameters. @MaartenMarsman me know what you think. If this approach is the way to go, then I will also include the new arguments in the roxygen of bgms.R.

Copy link
Collaborator

@MaartenMarsman MaartenMarsman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this update @sekulovskin. I have three suggestions for the code update, see my comments:

  1. The null check on between parameters I think always stops bgm because between parameters default to null. I think it is better to not pass null values (see comment 3).
  2. There is a change in NUTS default, perhaps this is due to a recent update to bgms main. Could you revert this?
  3. I suggest to not add a switch to all SBM functions, but instead simply pass between parameters everywhere. Then full control over the model is in the R interface, and the c++ code update simplifies. Let me know if you need help with this!

~ Maarten

stop("If you wish to specify different between and within cluster probabilites,
provide both beta_bernoulli_alpha_between and beta_bernoulli_beta_between,
otherwise leave both NULL.")
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I read this correctly, this will stop the analysis if the between parameters are left at their defaults. This means users cannot use bgms, except when they set other values for these defaults, irrespective if they use an SBM prior or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, this is in case the user specifies only one of the between parameters, but not both. Otherwise running the code below did work. But it doesn't matter now, since as you requested, both sets of hyperparameters are always provided.

fit <- bgm(Wenchuan[c(1:100), c(1:5)], edge_prior = "Stochastic-Block",
beta_bernoulli_alpha = 1,
beta_bernoulli_beta = 1,
beta_bernoulli_alpha_between = NULL,
beta_bernoulli_beta_between = NULL,
update_method = "adaptive-metropolis",
iter = 1000)

@MaartenMarsman MaartenMarsman merged commit c925d92 into Bayesian-Graphical-Modelling-Lab:main Nov 12, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants