R/frontend-averaging.R

Defines functions inclusion.threshold averaged.network

Documented in averaged.network inclusion.threshold

# build the averaged network structure using arc strengths and a
# significance threshold.
averaged.network = function(strength, threshold) {

  # check the main argument.
  check.bn.strength(strength, valid = c("bootstrap", "bayes-factor"))
  # check the strength threshold.
  threshold = check.threshold(threshold, strength)

  avg = averaged.network.backend(strength = strength, threshold = threshold)

  # add the metadata for the print() method.
  avg$learning$algo = "averaged"
  avg$learning$args = list(threshold = threshold)

  return(avg)

}#AVERAGED.NETWORK

# compute the inclusion threshold from a set of arc strengths.
inclusion.threshold = function(strength) {

  # check the (only) argument.
  check.bn.strength(strength, valid = c("bootstrap", "bayes-factor"))

  threshold(strength = strength, method = "l1")

}#INCLUSION.THRESHOLD

Try the bnlearn package in your browser

Any scripts or data that you put into this service are public.

bnlearn documentation built on Sept. 11, 2024, 8:27 p.m.