-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
easybgm in jasp #124
base: master
Are you sure you want to change the base?
easybgm in jasp #124
Conversation
… of the prior options properly.
…e centrality measures when model = ggm || gcgm; added a note that the omrf is slow.
hurray, well done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks really good! I left some feedback below, just re-request a review once it's ready again.
export(BayesianNetworkAnalysis) | ||
export(NetworkAnalysis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did roxygen2 do this automatically? if yes all good, otherwise please revert the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was changed automatically.
R/bayesiannetworkanalysis.R
Outdated
easybgmFit <- try(easybgm::easybgm(data = as.data.frame(apply(dataset[[nw]], 2, as.numeric)), | ||
type = "continuous", | ||
package = "BDgraph" , | ||
iter = as.numeric(options[["iter"]]), | ||
save = TRUE, | ||
centrality = FALSE, | ||
burnin = as.numeric(options[["burnin"]]), | ||
g.start = options[["initialConfiguration"]], | ||
df.prior = as.numeric(options[["dfprior"]]), | ||
g.prior = as.numeric(options[["gprior"]]))) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
easybgmFit <- try(easybgm::easybgm(data = as.data.frame(apply(dataset[[nw]], 2, as.numeric)), | |
type = "continuous", | |
package = "BDgraph" , | |
iter = as.numeric(options[["iter"]]), | |
save = TRUE, | |
centrality = FALSE, | |
burnin = as.numeric(options[["burnin"]]), | |
g.start = options[["initialConfiguration"]], | |
df.prior = as.numeric(options[["dfprior"]]), | |
g.prior = as.numeric(options[["gprior"]]))) | |
easybgmFit <- try(easybgm::easybgm(data = dataset[[nw]], | |
type = "continuous", | |
package = "BDgraph" , | |
iter = options[["iter"]], | |
save = TRUE, | |
centrality = FALSE, | |
burnin = options[["burnin"]], | |
g.start = options[["initialConfiguration"]], | |
df.prior = options[["dfprior"]], | |
g.prior = options[["gprior"]])) |
so in principle, the data should already be in the right format at this point (e.g., a data.frame
with only numeric values). In addition, the values from the options should also be actual values already. So the removed lines should be redundant. If these lines are somehow not redundant, then this should probably be fixed when reading the data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed most of the arguments. Except for transforming the variables to numeric when model == "ggm" || "gcgm". This is because if you pass non-numeric variables to easybgm when using BDgraph, an error occurs internally in the get_S_n_p function. I did not want to alter the .networkAnalysisReadData function, which is used for all network analyses. However, I am open to suggestions if you think this needs to be handled differently.
cb036cb
to
2ea84cb
Compare
…orkAnalysisNetworkPlot function to handle estimator/model based on the selected method; (2) corrected the silly loop when estimating the omrf; (3) deleted somestimating the omrf; (3) deleted some redundant comments; (4) changed the footnote under the table. Round 2 with the rest of the changes will follow soon.
Should be this in 0.19.2, or can it wait until the release afterwards? |
…, adjusted the arguments in functions, and some other small fixes.
Merge branch 'master' into easybgminJASP # Conflicts: # R/bayesiannetworkanalysis.R # inst/qml/BayesianNetworkAnalysis.qml
Implemented the easybgm package in JASP, which now works in place of BDgraph and can handle: ggms and gcgms (using BDgraph in the background) as well as the omrf (using bgms in the background).
There are also some other cosmetic changes like added footnotes and prior options.
For now, I only allow the software to compute credible intervals for the centrality measures when model == omrf.
The B-C model is not included yet, I will probably do that next week.