Class Sbn::Net
In: lib/formats.rb
lib/inference.rb
lib/learning.rb
lib/net.rb
Parent: Object

Methods

Constants

MCMC_DEFAULT_SAMPLE_COUNT = 2000

Attributes

name  [R] 
variables  [R] 

Public Class methods

Reconstitute a saved network.

Public Instance methods

Expects data to be an array of hashes containing complete sets of evidence for all variables in the network. Constructs probability tables for each variable based on the data.

Returns a hash containing the estimated posterior probability of each possible state for the specified variable, based on previously-supplied evidence, using the Markov Chain Monte Carlo algorithm. The MCMC algorithm generates each event by making a random change to the preceding event. The next state is generated by randomly sampling a value for one of the nonevidence variables Xi, conditioned on the current values of the variables in the Markov blanket of Xi. MCMC basically wanders randomly around the state space—the space of possible complete assignments—flipping one variable at a time, but keeping the evidence variables fixed. The sampling process works because it settles into a "dynamic equilibrium" in which the long-run fraction of time spent in each state is proportional to its posterior probability.

Optionally accepts a block that receives a number between 0 and 1 indicating the percentage of completion.

Returns a string containing a representation of the network in XMLBIF format. www.cs.cmu.edu/afs/cs/user/fgcozman/www/Research/InterchangeFormat

[Validate]