Learn R Programming

deal (version 1.2-42)

prob: Local probability distributions

Description

Methods for accessing or changing the local probability distributions and for accessing the local prior and posterior distributions

Usage

prob(x,df,...)

# S3 method for node prob (x,df,nw,...) # S3 method for network prob (x,df,...)

localprob(nw) localprob(nw,name) <- value

localprior(node) localposterior(node)

Arguments

x

an object of class node or network.

df

a data frame, where the columns define the variables. A continuous variable should have type numeric and discrete varibles should have type factor.

nw

an object of class network.

node

an object of class node.

name

a string, which gives the node name.

...

additional arguments for specific methods.

value

If the node is continuous, this is a numeric vector with the conditional variance and the conditional regression coefficients arising from a regression on the continuous parents, using data. If the node has discrete parents, it is a matrix with a row for each configuration of the discrete parents. If the node is discrete, it is a multiway array which gives the conditional probability distribution for each configuration of the discrete parents.

Author

Susanne Gammelgaard Bottcher,
Claus Dethlefsen rpackage.deal@gmail.com.

Details

The prob methods add local probability distributions to each node. If the node is continuous, this is a numeric vector with the conditional variance and the conditional regression coefficients arising from a regression on the continuous parents, using data. If the node has discrete parents, prob is a matrix with a row for each configuration of the discrete parents. If the node is discrete, prob is a multiway array which gives the conditional probability distribution for each configuration of the discrete parents. The generated prob can be replaced to match the prior information available.

localprob returns the probability distribution for each node in the network.

In a learned network, the local prior and posterior can be accessed for each node using localprior and localposterior.