Skip to content

Commit

Permalink
updated the options for the priors; excluded the CrI intervals for th…
Browse files Browse the repository at this point in the history
…e centrality measures when model = ggm || gcgm; added a note that the omrf is slow.
  • Loading branch information
sekulovskin committed Nov 12, 2024
1 parent 46133a3 commit 2ea84cb
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 42 deletions.
7 changes: 7 additions & 0 deletions R/bayesiannetworkanalysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ BayesianNetworkAnalysis <- function(jaspResults, dataset, options) {
tb$addColumnInfo(name = "nonZero", title = gettext("Number of non-zero edges"), type = "string")
tb$addColumnInfo(name = "Sparsity", title = gettext("Sparsity"), type = "number")


if (options[["model"]] == "omrf") {

# add footnote
tb$addFootnote("The omrf model may require a substantial amount of time to complete. This time increases with the number of variables and the number of iterations.")
}

mainContainer[["generalTable"]] <- tb
}
return()
Expand Down
77 changes: 35 additions & 42 deletions inst/qml/BayesianNetworkAnalysis.qml
Original file line number Diff line number Diff line change
Expand Up @@ -62,14 +62,16 @@ Form
CheckBox { name: "edgeExclusion"; label: qsTr("Evidence for exclusion"); checked: true }
CheckBox { name: "edgeAbsence"; label: qsTr("Absence of evidence"); checked: true }
}
CheckBox {
name: "centralityPlot"; label: qsTr("Centrality plot")
CheckBox {
name: "credibilityInterval";
label: qsTr("Credibility interval 95%");
checked: false
}
}
CheckBox {
name: "centralityPlot"
label: qsTr("Centrality plot")
CheckBox {
name: "credibilityInterval"
label: qsTr("Credibility interval 95%")
checked: false
visible: model.currentValue === "omrf" // Show only when model is "omrf"
}
}
}

Group
Expand Down Expand Up @@ -115,27 +117,29 @@ Section {
spacing: 10
Layout.fillWidth: true

FormulaField {
name: "gprior"
label: qsTr("Prior edge inclusion probability:")
value: "0.5"
min: 0.001
max: 1
Layout.fillWidth: true
preferredWidth: 300
}

DropDown {
DropDown {
id: edgePrior
name: "edgePrior"
label: qsTr("Edge prior for the omrf:")
label: qsTr("Edge prior:")
Layout.fillWidth: true
preferredWidth: 300
values: [
{ value: "Bernoulli", label: "Bernoulli" },
{ value: "Beta-Bernoulli", label: "Beta-Bernoulli" },
{ value: "Stochastic-Block", label: "Stochastic-Block" }
]
visible: model.currentValue === "omrf"
}

FormulaField {
name: "gprior"
label: qsTr("Prior edge inclusion probability:")
value: "0.5"
min: 0.001
max: 1
Layout.fillWidth: true
preferredWidth: 300
visible: (model.currentValue === "ggm" || model.currentValue === "gcgm") || (model.currentValue === "omrf" && edgePrior.currentValue === "Bernoulli")
}

FormulaField {
Expand All @@ -145,6 +149,7 @@ Section {
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: (model.currentValue === "omrf") && (edgePrior.currentValue === "Beta-Bernoulli" || edgePrior.currentValue === "Stochastic-Block")
}

FormulaField {
Expand All @@ -154,6 +159,7 @@ Section {
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: (model.currentValue === "omrf") && (edgePrior.currentValue === "Beta-Bernoulli" || edgePrior.currentValue === "Stochastic-Block")
}

FormulaField {
Expand All @@ -163,37 +169,20 @@ Section {
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: (model.currentValue === "omrf") && (edgePrior.currentValue === "Stochastic-Block")
}

DropDown {
id: initialConfiguration
name: "initialConfiguration"
label: qsTr("Initial configuration prior edge inclusion (for ggm and gcgm):")
label: qsTr("Initial configuration prior edge inclusion:")
Layout.fillWidth: true
preferredWidth: 300
values: [
{ value: "empty", label: "empty" },
{ value: "full", label: "full" }
]
}


FormulaField {
name: "beta_bernoulli_alpha"
label: qsTr("Shape parameter 1:")
value: "1"
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
}

FormulaField {
name: "beta_bernoulli_beta"
label: qsTr("Shape parameter 2:")
value: "1"
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: model.currentValue === "ggm" || model.currentValue === "gcgm"
}
}
}
Expand All @@ -208,20 +197,22 @@ Section {

IntegerField {
name: "dfprior"
label: qsTr("Degrees of freedom of G-Wishart prior (for ggm and gcgm):")
label: qsTr("Degrees of freedom of G-Wishart prior:")
value: 3
min: 3
Layout.fillWidth: true
preferredWidth: 300
visible: model.currentValue === "ggm" || model.currentValue === "gcgm"
}

FormulaField {
name: "interactionScale"
label: qsTr("Scale of the Cauchy distribution for the edge weights (for omrf):")
label: qsTr("Scale of the Cauchy distribution for the edge weights:")
value: "2.5"
min: 0.1
Layout.fillWidth: true
preferredWidth: 300
visible: model.currentValue === "omrf"
}


Expand All @@ -232,6 +223,7 @@ Section {
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: model.currentValue === "omrf"
}

FormulaField {
Expand All @@ -241,6 +233,7 @@ Section {
min: 0.001
Layout.fillWidth: true
preferredWidth: 300
visible: model.currentValue === "omrf"
}
}
}
Expand Down

0 comments on commit 2ea84cb

Please sign in to comment.