Learn R Programming

EDISON (version 1.1.1)

calculateEdgeProbabilities: Calculate the edge probabilities.

Description

This function calculates the marginal posterior probabilities of the edges in the network segments, for each timepoint, and optionally calculates the same for specified changepoints.

Usage

calculateEdgeProbabilities(network.samples, cps = NULL)

Arguments

network.samples
Network samples obtained from the MCMC simulation using EDISON.run and runDBN.
cps
Optionally specifies changepoints to allow for calculating the marginal posterior edge probabilities for specific segments.

Value

A list with elements:
probs.all
A list containing marginal edge posterior probabilities for each timepoint.
probs.segs
A list containing marginal edge posterior probabilities for each specified segment.

See Also

calculateEdgeProbabilitiesTimePoints,

calculateEdgeProbabilitiesSegs

Examples

Run this code

# Generate random gene network and simulate data from it
dataset = simulateNetwork(l=25)

# Run MCMC simulation to infer networks and changepoint locations
result = EDISON.run(dataset$sim_data, num.iter=500)

# Calculate marginal posterior probabilities of edges in the network
network = calculateEdgeProbabilities(result)

# Calculate marginal posterior probabilities of edges in the network, 
# using the true changepoints
true.cps = c(2,dataset$epsilon)
network = calculateEdgeProbabilities(result, cps=true.cps)

Run the code above in your browser using DataLab