marginalProb {RVS}R Documentation

calculates the marginal probability of a set of nodes

Description

Given a bayesian network from the gRain package and a named list of (nodes, states), this function returns the joint-marginal probability of each node taking a value in the specified set of states.

Usage

marginalProb(net, states)

Arguments

net

bayesian network from gRain package

states

named list of states for each node

Details

This function calculates the probability P(A,B,C) by factoring it into conditional probabilities, i.e. P(A|B,C) * P(B|C) * P(C). Starting at the right side, P(C) is computed and then evidence of C being true is added to the network and P(B) is computed - effectively giving the probability P(B|C). This process continues from right to left until the entire product has been computed.

Value

joint-marginal probability


[Package RVS version 1.14.0 Index]