| get.belief {gRaven} | R Documentation |
Get beliefs in a gRaven domain
Description
Get beliefs (marginal joint probabilities) in a gRaven domain
Usage
get.belief(domain, nodes)
get.marginal(domain, nodes, class = c("data.frame", "table", "ftable", "numeric"))
Arguments
domain |
name of gRaven domain |
nodes |
character vector of names of nodes |
class |
desired class of output |
Details
Emulates functions of the same name in the RHugin package by calls to gRain functions. Unlike with RHugin, gRaven conditions on all entered evidence in reporting probabilities, not only propagated evidence.
Value
For get.marginal, a list with one component "table" which is a data frame, table, flat table or numeric vector of marginal joint probabilities, as specified by class.
For get.belief, a vector in the case of a single node (if there is no evidence on that node. a vector of ones), otherwise as get.marginal.
Differences from RHugin
get.belief handles more than one node at a time.
Author(s)
Peter J. Green, P.J.Green@bristol.ac.uk
Examples
demo("chest",package="gRaven",echo=FALSE)
compile(chest)
chest
set.finding(chest,"asia","yes")
set.finding(chest,"dysp","no")
propagate(chest)
get.belief(chest,"asia")
get.belief(chest,"tub")
get.marginal(chest,c('asia','xray','tub'))
[Package gRaven version 1.1.8 Index]