Learn R Programming

geneNetBP (version 2.0.1)

absorb-methods: Absorb evidence and propagate beliefs in a genotype-phenotype network

Description

Absorb a single piece or a spectrum of evidence for one or more phenotype nodes, propagate the beliefs, obtain the updated beliefs and quantify the effects.

Usage

## For Conditional Gaussian Bayesian Networks ## and Discrete Bayesian Networks (Implements RHugin) absorb.gnbp(object, node, evidence) ## For Discrete Bayesian Networks (Implements gRain) absorb.dbn(object, node, evidence)

Arguments

object
an object of class "gpfit" (output from fit.gnbp) for absorb.gnbp or an object of class "dbnfit" (Output from fit.dbn) for absorb.dbn.
node
a character vector specifying the names of the nodes for which the evidence is to be absorbed.
evidence
a matrix or a numeric vector of evidence. number of rows of the matrix or the length of the vector should be equal to the length of node.

Value

absorb.gnbp returns an object of class "gnbp" while absorb.dbn returns an object of class "dbn". An object of class "gnbp" or "dbn" is a list containing the following components.The marginals, beliefs and JSI or FC are calculated for only d-connected nodes.If a sequence of evidence is absorbed for a single node in a Conditional Gaussian network, a plot of JSI vs evidence is produced.

Details

The function absorb.gnbp is compatible with the output produced by fit.gnbp. It absorbs evidence in both conditional gaussian bayesian networks or discrete bayesian networks inferred by RHugin and propagates beliefs by the PC algorithm implemented in the RHugin package. Jeffrey's Signed information is calculated to quantify the effects of the evidence absorption on the marginals. Note that the demo version of HuginLite is restricted to 50 states and 500 cases.

The function absorb.dbn is compatible with the output produced by fit.dbn. It absorbs evidence in only discrete bayesian networks that are inferred by bnlearn. Belief propagation is implemented using gRain package.

See Also

gen.evidence, plot.gnbp, plot.dbn

Examples

Run this code

## load the mouse kidney eQTL dataset
data(mouse)

## get genotype and phenotype data
mousegeno<-mouse[,1:5]
mousepheno<-mouse[,6:19]

## Not run: 
# ## Simple example : Fit a bayesian network to genotype-phenotype data 
# mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)
# 
# ## Absorb a single evidence for a single node
# absorb.gnbp(mouse.cgbn,node="Tlr12",evidence=matrix(2.5))
# 
# ## Absorb a sequence of evidence for a single node generated using \code{\link{gen.evidence}
# mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)
# evidence<-gen.evidence(mouse.cgbn,node="Tlr12")
# absorb.gnbp(mouse.cgbn,node="Tlr12",evidence=evidence)
# 
# ##Absorb sequence of evidence for multiple nodes}
# mouse.cgbn<-fit.gnbp(mousegeno,mousepheno,alpha=0.1)
# evidence<-gen.evidence(mouse.cgbn,node=c("Ak2","Ptp4a2","Hmgcl"),std=2,std.equal=TRUE)
# absorb.gnbp(mouse.cgbn,node=rownames(evidence),evidence=evidence)
# ## End(Not run)

Run the code above in your browser using DataLab