Learn R Programming

gRaven (version 1.1.10)

get.belief: 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"))

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.

Arguments

domain

name of gRaven domain

nodes

character vector of names of nodes

class

desired class of output

Differences from RHugin

get.belief handles more than one node at a time.

Author

Peter J. Green, P.J.Green@bristol.ac.uk

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.

Examples

Run this code
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'))

Run the code above in your browser using DataLab