queryBN: Query Bayesian Network Model.

View source: R/queryBN.R

queryBNR Documentation

Query Bayesian Network Model.

Description

Performs inference in a Bayesian network model, which can be output from buildWeatherGenerator(), buildPredictive() and buildDescriptive().

Usage

queryBN(
  evidence,
  dbn,
  evidence.nodes,
  predictands,
  type = "exact",
  which_ = "marginal",
  resample.size = 10000,
  cl = NULL
)

Arguments

evidence

An evidence vector.

dbn

A Bayesian network model, as output by buildWeatherGenerator(), buildPredictive() or buildDescriptive()

evidence.nodes

Names of the nodes for which evidence will be provided. Must have the same length as evidence.

predictands

Nodes queried.

type

Inference type. Either "simulation", "approximate", "exact", or "random". Exact inference requires the compiled junction tree and gRain library. Approximate uses cpdist() function from bnlearn. Simulation is used for weather generation, and generates stochastic predictions. "random" generates a non spatially consistent observation, based directly on the probability vector obtained using only evidence nodes.

which_

Probabilities to return. Used only for exact inference.

resample.size

Number of samples for the likelihood weighting approximate inference method.

cl

A cluster object from parallel library, used only if "approximate" inference is selected.


MNLR/BNWeatherGen documentation built on June 2, 2023, 9:02 p.m.