Joint Probability

The engine.
Post Reply
vikramdoshi
Posts: 9
Joined: Mon Mar 04, 2013 10:41 am

Joint Probability

Post by vikramdoshi »

Hi
We have a Bayesian network, in which we want to compute the joint probability distribution of the class nodes (more than 1) given a set of evidence (feature) nodes.
We need to calculate the joint distribution, since we want to obtain the likelihood ratio of a certain combination of classes.

Are there any updates in the SMile Package which perform joint inference?

I can see that this question has partially been answered in the post.
http://genie.sis.pitt.edu/forum/viewtop ... oint#p2993
Is there any implementation for this? Or I should implement it myself?

Any help will be highly appreciated :)

Cheers
Vikram
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Joint Probability

Post by shooltz[BayesFusion] »

vikramdoshi wrote:Are there any updates in the SMile Package which perform joint inference?
SMILE has some support for joint probabilities now, but some of the currently available binaries were created before new features were added. Which platform (compiler version/OS) you're on?
vikramdoshi
Posts: 9
Joined: Mon Mar 04, 2013 10:41 am

Re: Joint Probability

Post by vikramdoshi »

We are working with VS 2010/Win 32
vikramdoshi
Posts: 9
Joined: Mon Mar 04, 2013 10:41 am

Re: Joint Probability

Post by vikramdoshi »

Hi

I was wondering if the joint inference is available in package
Visual Studio 2010 / VC 10.0 SP1
15.6 MB, September 15, 2012
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Joint Probability

Post by shooltz[BayesFusion] »

vikramdoshi wrote:I was wondering if the joint inference is available in package
Visual Studio 2010 / VC 10.0 SP1
15.6 MB, September 15, 2012
No, this one does not contain the functionality you're after. I'm going to refresh SMILE binaries built Visual Studio today (Wednesday, March 6)
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Joint Probability

Post by shooltz[BayesFusion] »

New SMILE builds are available. You can use the following methods in DSL_network class to get access to JPTs:

1) call EnableJptStore(true) on your network before UpdateBeliefs
2) after UpdateBeliefs you can get access to JPT tables with GetJpts. The first argument is the handle of your node. The second argument is an output, the vector of pair<vector<int>, const DSL_Dmatrix *>. The first element of the pair is the set of nodes indexing the second element, which is an actual JPT. Note that you can get more than one JPT for given node, depending on the triangulation performed during jointree construction.
vikramdoshi
Posts: 9
Joined: Mon Mar 04, 2013 10:41 am

Re: Joint Probability

Post by vikramdoshi »

I am not sure if I completely understood how to go about with it.

I have attached the test code which I used, after it didn't work for my network.

The vecJPTs vector is always empty.
(I tried even initializing it to some values but after the GetJpts function call it becomes empty. So I guess there is something happening in GetJpts, which I cant understand!)

Is it because I am using Pearl's Inference algo?
Where am I going wrong? :)

Code: Select all

	//	Opening the network
	DSL_network testNet;
	//	Network contains 3 nodes with their Identifier names as A, B, X
	testNet.ReadFile("Test_1.dsl");

		/* 	Pearl's Inference Algorithm
	-	Exact Algorithm
	-	For Polytrees only
	-	Like Lauritzen based on message passing, but now messages are passed between original nodes 
		and not cliques nodes of a join tree */
	testNet.SetDefaultBNAlgorithm(DSL_ALG_BN_PEARL);
	
	//	Get the handle of node "A"
	int nodeA = testNet.FindNode("A");

	//	Get the handle of node "X"
	int nodeX = testNet.FindNode("X");

	//	Set Evidence on Node X
	testNet.GetNode(nodeX)->Value()->SetEvidence(0);
	
	//	Enable JPT Storing
	testNet.EnableJptStore(true);

	//	Update the network
	testNet.UpdateBeliefs();

	//	To store the JPTs
	vector<	pair<vector<int>,const DSL_Dmatrix *>> vecJPTs;

	//	Get JPT's
	int err= testNet.GetJpts(nodeA,vecJPTs);
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Joint Probability

Post by shooltz[BayesFusion] »

Is it because I am using Pearl's Inference?
Exactly. JPTs are retrieved from jointree creted during clustering.

Why are you using Pearl's algorithm instead of the default?
vikramdoshi
Posts: 9
Joined: Mon Mar 04, 2013 10:41 am

Re: Joint Probability

Post by vikramdoshi »

We are building a network for forensic applications..

So I wanted an exact inference algo!
Any way out?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: Joint Probability

Post by shooltz[BayesFusion] »

The default SMILE algorithm (clustering) is exact.
Post Reply